Closed bukzor closed 4 years ago
String.split.go
was just an auxiliary, your solution is much simpler.
Can you update the case
s to be in a new line? For example:
// Line 8
| true =>
case using:
| nil => List.cons<String>(String.cons(xs.head, String.nil), String.split(xs.tail, using));
| cons => List.cons<String>("", String.split(String.drop(String.length(using), xs), using));
;
Also, the ;
goes bellow the |
that it "closes" or with the last ;
. We need a document explaining these conventions.
...
| case f(xs.head):
| String.cons(xs.head,String.filter(f, xs.tail));
| String.filter(f, xs.tail);; <-- here
Also, I didn't know about the use of The
for tests, really cool!
I think we can also improve the using
parameter. What do you think about "separator", "sep" or "match"?
I think it can be simplified a little bit still, probably inspired on List.chunks_of, but looks great. Merging.
This is an import of what I made before I realized this already existed. Was there some subtle reason for String.split.go to exist?