[Haskell-beginners] MonadThrow, MonadReader and shake

Sylvain Henry sylvain at haskus.fr
Tue Dec 18 10:56:03 UTC 2018


>> If you want `m ~ ReaderT Beamline m IO`, you can use something like:
>> `liftIO $ runReaderT stateBeforeCallingShake $ toRuchePath attachements`
>> (you need `stateBeforeCallingShake <- ask` before calling shake).
> ok, I will check this :).
I've swapped the args above, it should be:

liftIO $ runReaderT (toRuchePath attachements) stateBeforeCallingShake

> Does it mean that if an instance of the MonadReader was writtent for shake (Action). it should work out of the box ?

With additional `MonadThrow Action` and `MonadReader Beamline Action` 
instances it should work. But the MonadReader one is really specific to 
your use case.

Cheers,
Sylvain



More information about the Beginners mailing list