简体   繁体   中英

Monads = Functors + Idempotency (of type)?

In Haskell, Monads are defined by kleisli triple.

In Category theory in general, is it fine to say:

Monads = Functors + Idempotency of the monadic type (not the value)?

No, a monad is emphatically not idempotent: although there is a requirement that there be a natural transformation

mu_x : T(T(x)) -> T(x)

it is in general not the case that the two objects selected in this way are equal, that is,

T(T(x)) = T(x)

does not generally hold, even up to isomorphism.

Even in the restricted land of Haskell Monad it is easy to see this in action: Maybe (Maybe ()) and Maybe () are clearly inequal types with different numbers of semantic objects; ignoring bottoms:

Nothing, Just () -- Maybe ()
Nothing, Just Nothing, Just (Just ()) -- Maybe (Maybe ())

or with bottoms:

_|_, Nothing, Just _|_, Just () -- Maybe ()
_|_, Nothing, Just _|_, Just Nothing, Just (Just _|_), Just (Just ()) -- Maybe (Maybe ())

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM