How to write a monad that prints “step i of N” when executing each statement in the monad?

后端 未结 5 1399
清歌不尽
清歌不尽 2021-02-15 10:38

I\'m not even sure this is possible in any kind of monad; does it violate monad laws? But it seems like something that should be possible in some kind of construct or other. S

5条回答
  •  名媛妹妹
    2021-02-15 11:19

    There are a lot of logger libraries.

    If you are interested in Monad-Logger - here you are: Control.Monad.Logger

    And at the Hackage you could find other libraries

提交回复
热议问题