I'm looking for the unit functor/monad
data Unit a = Unit
I could easily recreate it, but I'd rather not duplicate something this basic. It used to live in Control.Functor
in the category-extras package (http://hackage.haskell.org/packages/archive/category-extras/0.1/doc/html/Control-Functor.html). I can't find it with Hoogle, or in the map of where the pieces of category-extras went to live (http://hackage.haskell.org/package/category-extras-1.0.2)
It seems like it should live in the transformers package, since that's where Control.Monad.Identity
went (it's now Data.Functor.Identity
).
The closest existing library code I can come up with is
type Unit a = Constant () a
using Data.Functor.Constant
from the transformers package.