Creative uses of monads

后端 未结 8 805
再見小時候
再見小時候 2020-12-07 07:39

I\'m looking for creative uses of monads to learn from. I\'ve read somewhere that monads have been used for example in AI, but being a monad newbie, I fail to see how.

8条回答
  •  渐次进展
    2020-12-07 08:27

    One of my favorite monads is Martin Escardo's search monad. It can be found on hackage in infinite-search package.

    It is the monad of "search functions" for a set of elements of type a, namely (a -> Bool) -> Maybe a (finding an element in the set matching a given predicate).

提交回复
热议问题