4 ms·
This is explicitly not a writeup for beginners ( ergo the title ), it's a side-by-side description of the /very/ general categorical description and how you can
by freyrs3 13y ago
This is explicitly not a writeup for beginners ( ergo the title ), it's a side-by-side description of the /very/ general categorical description and how you can model that in Haskell. The three parameter form of morphism composition ( i.e. c y z -> c x y -> c x z ) would be quite unwieldy in day-to-day programming but it does illustrate the underlying definitions better to have categories explicit.
- trobertson 13y agoI don't mean to nitpick, but the three parameter form is exactly what you use in day-to-day Haskell programming. You simply let c be the infix (->), and you get (y -> z) -> (x -> y) -> (x -> z). We just tend to think of it as a two parameter form because a lot of the time, you can think of (->) as syntax, as opposed to the type that it is.
- lelf 13y agoYup. This is straight cut from Control.Category module: instance Category (->) where id = Prelude.id (.) = (Prelude..)