Skip to content

Instantly share code, notes, and snippets.

@andys8
Created August 6, 2017 13:51
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andys8/003501db1db394aae71126dddb1f43b1 to your computer and use it in GitHub Desktop.
Save andys8/003501db1db394aae71126dddb1f43b1 to your computer and use it in GitHub Desktop.
A cheatsheet to have the fantasy land algebraic specification at a glance

Algebras

Algebra Methods
Functor map
Apply ap, map
Applicative of, ap, map
Chain chain, ap, map
Monad chain, of, ap, map
Bifunctor bimap, map
Profunctor promap, map
Extend extend, map
Comonad extract, extend, map
Foldable reduce
Traversable traverse, reduce, map
Semigroupoid compose
Category id, compose
Semigroup concat
Monoid empty, concat
Setoid equals
Ord lte, equals

More

Alt, Plus, Alternative, Contravariant

Methods

map :: Functor f => f a ~> (a -> b) -> f b
ap :: Apply f => f a ~> f (a -> b) -> f b
of :: Applicative f => a -> f a
chain :: Chain m => m a ~> (a -> m b) -> m b
bimap :: Bifunctor f => f a c ~> (a -> b, c -> d) -> f b d
promap :: Profunctor p => p b c ~> (a -> b, c -> d) -> p a d
extend :: Extend w => w a ~> (w a -> b) -> w b
extract :: Comonad w => w a ~> () -> a
reduce :: Foldable f => f a ~> ((b, a) -> b, b) -> b
traverse :: Applicative f, Traversable t => t a ~> (TypeRep f, a -> f b) -> f (t b)
compose :: Semigroupoid c => c i j ~> c j k -> c i k
id :: Category c => () -> c a a
concat :: Semigroup a => a ~> a -> a
empty :: Monoid m => () -> m
equals :: Setoid a => a ~> a -> Boolean
lte :: Ord a => a ~> a -> Boolean

Dependencies

Dependencies

@andys8
Copy link
Author

andys8 commented Aug 6, 2017

dependencies

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