main :: IO ()
main = println "hello world"


return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b

“monoid in the category of endofunctors”

type constructors are endofunctors. A functor is

  1. a mapping ofobjects
  2. a mapping of morphisms

The standard model of category theory in haskell is

  1. types are objects
  2. morphisms are functions

Composition is (.). id are identity morphisms.

Note how weird this is. We’ve in some sense put types and values (haskell functions are values that inhabit function types) on the same level.

Maybe maps any type a to the the Maybe a

Free Monads

Recursion Schemes and F-Algebras

A different category

f a -> a

  • objects are haskell functions of this type and the type a. Again a bizarre (depending on your background) mixing of values and types
  • morphisms are squares. Very very weird.

a -> f a


Unboxed types

kinds are calling conventions levity polymorphism

STG and low level

Low level ocaml and haskell

The STG. It’s curiously like a Bohm mararducci or finally tagless. Constructors are function points. I mean. They’re both called tagless. push-enter vs eval-apply continuation primop crazy slides on the full stack stg interpeter. but also a good read –ddump-ds –ddump-stg


native delim contby alexis king recursion schemes and comonads - Tielen