This repo implements a Prefix List in ocaml as a way to play with ocaml.
nix develop
dune runtest
When I have the context in my head, the types just get in the way.
This is a really cool feature that when used well leads to come staisfying patterns. See the tests for examples.
This is probably the thing I like most about ocaml. The ability to curry a function without needing to create another closure makes it very slick to pass partial applications around.
This is probably because ocmal is old and niche but I had a hard time trying to figure out what the "right" way to implement equality comparison is. which do I implement:
- val contains:
t -> t -> int
- val equals:
t -> t -> bool
- val (=):
t -> t -> bool
There seem to be many approaches on testing.
Makes it hard to debug errors things when calling the wrong funciton ends up as a type error somewhere else.
some of this stuff is crazy
declaring parameter names on functions defined in mli is annoying because the syntax does not match ml file