HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulerebase-1.21.2Haskell2010

Rebase.Control.Monad.Identity

  • 2 types
  • 3 values
  • Packagerebase-1.21.2
  • Exports5
  • LanguageHaskell2010
  • LicenceMIT
  • SourceIdentity.hs
newtypenewtype Identity a
#

Identity functor and monad. (a non-strict monad)

Examples
Example1 expression
fmap (+1) (Identity 0)Identity 1
Example1 expression
Identity [1, 2, 3] <> Identity [4, 5, 6]Identity [1,2,3,4,5,6]
>>> do
      x <- Identity 10
      y <- Identity (x + 5)
      pure (x + y)
Identity 25

Constructors

Instances88Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype IdentityT (f :: k -> Type) (a :: k)
#

The trivial monad transformer, which maps a monad to an equivalent monad.

Constructors

Instances83MonadRWS, Generic1, MonadAccum, MonadError, MonadReader, MonadState, …