News for hackers. Stuff that matters.
Re:Why We Use OCaml by tel on Wednesday July 16, 2014 @06:58PM (#8045100)
Jon mentioned modularity, so what I imagine he's talking about is functors. They have a scary name (and no relation to Haskell functors) so you might rather call them parametric signatures and they allow one signature to depend upon a previously defined one. Ultimately that means that you can decompose signatures into constituent, reusable parts which is nifty sounding but transformative in how you express APIs
Re:Why We Use OCaml by jonsterling on Wednesday July 16, 2014 @07:51PM (#8045258)
Functors are not parameterized signatures: they do not allow a signature to depend upon another signature, but rather a structure to depend on another structure. (However, SML/NJ has an extension called `funsig` which does what you have described).
Re:Why We Use OCaml by tel on Thursday July 17, 2014 @12:28AM (#8046051)
Oomph. That's what I get for talking about OCaml after not using it for a really long time, s/signature/struct/.
Re:Why We Use OCaml by innguest on Thursday July 17, 2014 @12:00AM (#8045999)
How is it that they have no relation to Haskell functors?

> Functors are, roughly speaking, functions from modules to modules (https://realworldocaml.org/v1/en/html/functors.html)

Functors in haskell have functions (fmap) that take a value (a function) from one category into another.

Are they not at least the same Functor as in Category Theory?

Re:Why We Use OCaml by tel on Thursday July 17, 2014 @12:27AM (#8046049)
Well, they're related at that level. Many, many things are category theoretic functors, though. It's a very general idea of a structure-preserving map between structures.