What is the difference between a monad and a closure?

后端 未结 4 1050
别跟我提以往
别跟我提以往 2021-02-08 11:24

i am kinda confused reading the definition between the two. Can they actually intersect in terms of definition? or am i completely lost? Thanks.

4条回答
  •  有刺的猬
    2021-02-08 12:22

    I think monads are a little more complicated than closures because closures are just blocks of code that remember something from the point of their definitions and monads are a construct for "twisting" the usual function composition operation.

提交回复
热议问题