Chirmol Studio
Chirmol Studio

Reputation: 177

Uniqueness of fmap in monads

Given a monad with return and >>=, apparently fmap f m = m >>= return . f is a valid definition that respects both the functor and monad laws.

But is this definition unique? I mean, if there is another fmap' that respects both laws, does it follow that fmap' = fmap?

Can fmap f m = m >>= return . f be derived solely from the functor and monad laws?

Upvotes: 0

Views: 41

Answers (0)

Related Questions