What is the difference between different orderings of the same monad transformers?

前端 未结 5 1414
你的背包
你的背包 2021-01-31 18:09

I am attempting to define an API to express a particular type of procedure in my program.

newtype Procedure a = { runProcedure :: ? }

There is

5条回答
  •  无人共我
    2021-01-31 18:27

    You'll be able to answer the question yourself if you try to write "run" functions for both versions - I don't have MTL + transformers installed so I'm not able to do it myself. One will return (Maybe a,state) the other Maybe (a,state).

    Edit - I've truncated my response as it adds detail which might be confusing. John's answer hits the nail on the head.

提交回复
热议问题