Closed TimWhiting closed 10 months ago
Forgot to match on b. split returns nil as the second value when it reaches the end:
fun splitBy(l: list<a>, i: int): div list<list<a>>
val (a, b) = l.split(i)
match b
Nil -> Cons(a, Nil)
_ -> Cons(a, b.splitBy(i))