Why are side-effects modeled as monads in Haskell?

前端 未结 8 923
无人共我
无人共我 2020-12-02 03:30

Could anyone give some pointers on why the impure computations in Haskell are modelled as monads?

I mean monad is just an interface with 4 operations, so what was th

8条回答
  •  清歌不尽
    2020-12-02 03:50

    AFAIK, the reason is to be able to include side effects checks in the type system. If you want to know more, listen to those SE-Radio episodes: Episode 108: Simon Peyton Jones on Functional Programming and Haskell Episode 72: Erik Meijer on LINQ

提交回复
热议问题