| Copyright | (c) Andy Gill 2001 (c) Oregon Graduate Institute of Science and Technology 2001 |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | [email protected] |
| Stability | stable |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
The identity functor and monad.
This trivial type constructor serves two purposes:
Identity. For example, State s is an abbreviation for StateT s Identity.Since: base-4.8.0.0
Identity functor and monad. (a non-strict monad)
>>> fmap (+1) (Identity 0) Identity 1
>>> 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
Since: base-4.8.0.0
| Identity | |
Fields
| |
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/base-4.21.0.0-8e62/Data-Functor-Identity.html