Module Data.Functor.Const

This simple module defines the const functor known from Haskell's base libraries. It defines a wrapper around a constant value that "ignores" functions mapped over it.

Exported Datatypes:

Exported Datatypes


newtype Const a _

The Const functor which returns a constant for any fmap, i.e., a wrapper around a constant value that ignores functions mapped over it.

Example:

> fmap (++ "world") (Const "Hello")
Const "Hello"

Constructor:

Const :: a -> Const a _

Fields:

  • getConst :: a

Known instances: