зеркало из
https://github.com/iharh/notes.git
synced 2025-10-30 05:06:05 +02:00
8 строки
221 B
Plaintext
8 строки
221 B
Plaintext
Identity monad:
|
|
|
|
newtype Identity a = Identity { runIdentity :: a }
|
|
|
|
instance Monad Identity where
|
|
return a = Identity a -- i.e. return = id
|
|
(Identity x) >>= f = f x -- i.e. x >>= f = f x
|