[Haskell-beginners] MonadThrow, MonadReader and shake

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Thu Dec 13 13:33:55 UTC 2018

> Using LiftIO should work fine!

I endup with this error

src/XdsMe.hs:214:31-52: error:
    • Could not deduce (Control.Monad.Reader.Class.MonadReader
                          Beamline IO)
        arising from a use of ‘toRuchePath’
      from the context: t ~ 'Collect
        bound by a pattern with constructor:
                   SCollect :: SCollectType 'Collect,
                 in an equation for ‘xdsme'’
        at src/XdsMe.hs:183:30-37
      or from: f ~ 'ISPyB.DataCollection.Hdf5
        bound by a pattern with constructor:
                   SHdf5 :: SCollectSourceFormat 'ISPyB.DataCollection.Hdf5,
                 in an equation for ‘xdsme'’
        at src/XdsMe.hs:183:39-43
    • In the second argument of ‘($)’, namely ‘toRuchePath attachment’
      In a stmt of a 'do' block:
        attachment' <- liftIO $ toRuchePath attachment
      In the expression:
        do { need [toFilePath xml];
             container <- liftIO . fromFile . toFilePath $ xml;
             let attachment
                   = _autoProcProgramAttachment . _autoProcProgramContainer
                     $ container;
             attachment' <- liftIO $ toRuchePath attachment;
             .... }

Here the signature of the function

xdsme' :: SomeDataCollection
       -> Maybe Cell
       -> Maybe SpaceGroup
       -> GZiped
       -> [Path Abs File]
       -> ReaderT Beamline IO ()
xdsme' c@(SomeDataCollection SCollect SHdf5 _) cell sg z is = do

More information about the Beginners mailing list