talira

semigroupoids

id-free versions of Haskell's Category, Applicative, Monad and related type classes

open sourceBSD-2-Clausefree

semigroupoids is a Haskell library of type classes without identities: a semigroupoid is a Category without id. It defines Semigroupoid, Apply (Applicative without pure), Bind (Monad without return), Alt and Plus (Alternative without empty), Traversable1, Biapply, and the contravariant Divise, Decide and Conclude, each placed in the class hierarchy beside the base and contravariant classes it relates to, with supporting functions and data types.

Problems it solves

  • use <*> on a Haskell type that can't implement pure
  • a Monad-like bind for a functor with no sensible return
  • combine non-empty structures in Haskell without an empty value

Features

  • Semigroupoid: Category without id
  • Apply and Bind: Applicative without pure, Monad without return
  • Alt and Plus: Alternative without empty
  • Traversable1, Biapply, and the contravariant Divise, Decide and Conclude