Hacker News new | ask | show | jobs
by Drup 3708 days ago
You can, that's precisely why we have functors and for this kind of use cases (abstracting a module over another), they are much nicer than type classes.
1 comments

As far as I understand, this would only work if standard sequence types were defined inside a functor, which is not the case.
The Ocaml std library is a bit lackluster and people often replace it with something more featureful.

BTW, I think https://github.com/c-cube/sequence is more in closer to the generic iterable datatype you are looking for. You still need to convert to and from the seq type but its pretty close...