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

Modulebasement-0.0.16Haskell2010

Basement.Compat.Identity

Identity re-export, with a compat wrapper for older version of base that do not have Data.Functor.Identity

  • 1 type
  • Packagebasement-0.0.16
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • 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

Instances37Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …