Most of the Haskell code that I see uses straightforward structures like lists and trees. For example, Haskeller usually writes:
fillRect :: Color β Bounds β Image β Image
This template has a problem: if later the programmer decides to change the definition of "Image" or use a different data structure, then he will have to reorganize each piece of code using it . In OCaml, you can simply use the module that defines the interface for the image, and then later define specific implementations.
What is the Haskell alternative for OCaml modules?
module haskell ocaml
Maiavictor
source share