[Haskell-beginners] MonadThrow, MonadReader and shake

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Fri Dec 14 11:29:20 UTC 2018


Hello,

In fact I do not understand this error message, and thus I do not understand how to fix this ?
How Can I give hint to ghc in order to fix this compilation error.

thanks for your help.

Frederic

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