Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


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).


Oomph. That's what I get for talking about OCaml after not using it for a really long time, s/signature/struct/.


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?


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: