What is so special about Monads?

前端 未结 5 2110
深忆病人
深忆病人 2021-01-31 04:00

A monad is a mathematical structure which is heavily used in (pure) functional programming, basically Haskell. However, there are many other mathematical structures available, l

5条回答
  •  萌比男神i
    2021-01-31 04:39

    Monads are special because of do notation, which lets you write imperative programs in a functional language. Monad is the abstraction that allows you to splice together imperative programs from smaller, reusable components (which are themselves imperative programs). Monad transformers are special because they represent enhancing an imperative language with new features.

提交回复
热议问题