Acid-state: MonadState instance for Update

前端 未结 1 892
梦如初夏
梦如初夏 2020-12-21 00:23

I\'m trying acid-state. The documentation states that Update st is an instance of MonadState st. I tried different things, but my comp

相关标签:
1条回答
  • 2020-12-21 01:07

    Ok, I finally solved it.

    The issue was with two different mtl versions installed. Hiding the wrong one fixed everything.

    The interesting part is how I got it :)

    Prelude Data.Acid Control.Monad.State> :i Update
    newtype Update st a
      = acid-state-0.6.4:Data.Acid.Common.Update {acid-state-0.6.4:Data.Acid.Common.unUpdate :: transformers-0.2.2.0:Control.Monad.Trans.State.Lazy.State
                                                                                                  st a}
        -- Defined in `acid-state-0.6.4:Data.Acid.Common'
    instance Monad (Update st)
      -- Defined in `acid-state-0.6.4:Data.Acid.Common'
    instance Functor (Update st)
      -- Defined in `acid-state-0.6.4:Data.Acid.Common'
    Prelude Data.Acid Control.Monad.State>
    

    Control.Monad.State reexports State, but you can see that ghci still shows transformers-0.2.2.0:Control.Monad.Trans.State.Lazy.State fully qualified.

    0 讨论(0)
提交回复
热议问题