Hacker News new | ask | show | jobs
by OnleMeMeMe 3963 days ago
What helps most beginners with Monads etc. is seeing it from a problem perspective: You have two things and want to combine them to get a third thing. Depending on how these things are 'wrapped' you need different concepts:

  Monoid: A + B (|+|)
  Functor: M[A] => (A => B) => M[B]
  Monad: M[A] => (A => M[B]) => M[B]
  Applicative: M[A] => M[A=>B] => M[B]
  Kleisli: (A => M[B]) => (B => M[C]) => (A => M[C])