Skip to content

Instantly share code, notes, and snippets.

Last active January 8, 2016 04:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Foldable&Monoid と Traverse&Applicative の関係

Monoid[G]G に入る型は型引数をとらない kind が * の型だけど、仮に * の型にダミーの型引数 [.] をつけて G[.] と表現してみると

Method Constraint Signature
Foldable#foldMap Monoid[G] F[A] => (A => G[.]) => G[....]
Traverse#traverse Applicative[G] F[A] => (A => G[B]) => G[F[B]]
Foldable#fold Monoid[G] F[G[.]] => G[....]
Traverse#sequence Applicative[G] F[G[A]] => G[F[A]]


Copy link

xuwei-k commented Sep 11, 2015

Copy link


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment