Can liftM differ from liftA?

前端 未结 2 1266
醉话见心
醉话见心 2021-02-01 03:21

According to the Typeclassopedia (among other sources), Applicative logically belongs between Monad and Pointed (and thus Functor

2条回答
  •  清歌不尽
    2021-02-01 03:34

    They can differ, but they shouldn't.

    They can differ because they can have different implementations: one is defined in an instance Applicative while the other is defined in an instance Monad. But if they indeed differ, then I'd say the programmer who wrote those instances wrote misleading code.

    You are right: the functions exist as they do for historical reasons. People have strong ideas about how things should have been.

提交回复
热议问题