Is there no standard (Either a) monad instance?

前端 未结 4 1873
一整个雨季
一整个雨季 2021-01-01 18:14

I was under the impression that there was an instance for Either a somewhere, but I can\'t seem to find it. I have tried importing Control.Monad, Control.Monad.Instances and

4条回答
  •  伪装坚强ぢ
    2021-01-01 18:32

    This instance has been added in base 4.3.x.x, which comes with ghc 7. Meanwhile, you can use the Either instance directly, or, if you are using Either to represent something that may fail you should use ErrorT monad transformer.

提交回复
热议问题