3 ms·
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 cal
by tel 12y ago
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
- jonsterling 12y agoFunctors 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).
- tel 12y agoOomph. That's what I get for talking about OCaml after not using it for a really long time, s/signature/struct/.
- innguest 12y agoHow 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 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?
- tel 12y agoWell, 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.