Sha256: b036680a2b11bbe1ae069c00adece4a57d9eaf7732501f5bcd457ee63f4698c7
Contents?: true
Size: 526 Bytes
Versions: 396
Compression:
Stored size: 526 Bytes
Contents
object Sublist extends Enumeration { def sublist[T](l1: List[T], l2: List[T]): Value = { if (equal(l1, l2)) Equal else if (isSublist(l1, l2)) Sublist else if (isSuperlist(l1, l2)) Superlist else Unequal } private def equal[T](l1: List[T], l2: List[T]) = l1.equals(l2) private def isSublist[T](l1: List[T], l2: List[T]) = l2.containsSlice(l1) private def isSuperlist[T](l1: List[T], l2: List[T]) = l1.containsSlice(l2) type SublistType = Value val Equal, Sublist, Superlist, Unequal = Value }
Version data entries
396 entries across 396 versions & 1 rubygems