BioHaskell / hPDB

PDB parser in Haskell
Other
20 stars 7 forks source link

Lots of MonadFail errors #11

Open locallycompact opened 1 year ago

locallycompact commented 1 year ago
hPDB> Bio/PDB/StructureBuilder/Internals.hs:47:72: error:
hPDB>     • Couldn't match type ‘s0’ with ‘s’
hPDB>       Expected: StateT
hPDB>                   (BState s0) (ST.ST s) (Structure, Data.Vector.Vector PDBEvent)
hPDB>         Actual: StateT
hPDB>                   (BState s0) (ST.ST s0) (Structure, Data.Vector.Vector PDBEvent)
hPDB>     • because type variable ‘s’ would escape its scope
hPDB>     This (rigid, skolem) type variable is bound by
hPDB>       a type expected by the context:
hPDB>         forall s. ST.ST s (Structure, List PDBEvent)
hPDB>       at Bio/PDB/StructureBuilder/Internals.hs:(46,41)-(48,88)
hPDB>     • In the first argument of ‘evalStateT’, namely ‘parsing’
hPDB>       In a stmt of a 'do' block: (s, e) <- evalStateT parsing initial
hPDB>       In the second argument of ‘($)’, namely
hPDB>         ‘do initial <- initializeState
hPDB>             (s, e) <- evalStateT parsing initial
hPDB>             return (s :: Structure, e :: List PDBEvent)’
hPDB>     • Relevant bindings include
hPDB>         initial :: BState s
hPDB>           (bound at Bio/PDB/StructureBuilder/Internals.hs:46:44)
hPDB>         parsing :: StateT
hPDB>                      (BState s0) (ST.ST s0) (Structure, Data.Vector.Vector PDBEvent)
hPDB>           (bound at Bio/PDB/StructureBuilder/Internals.hs:49:9)
hPDB>    |
hPDB> 47 |                                            (s, e)  <- State.evalStateT parsing initial
hPDB>    |                                                                        ^^^^^^^
hPDB> Bio/PDB/StructureBuilder/Internals.hs:49:71: error:
hPDB>     • No instance for (MonadFail (ST.ST s0))
hPDB>         arising from a use of ‘parseStep’
hPDB>     • In the expression: parseStep ev
hPDB>       In the third argument of ‘parsePDBRec’, namely
hPDB>         ‘(\ () !ev -> parseStep ev)’
hPDB>       In a stmt of a 'do' block:
hPDB>         parsePDBRec (BS.pack fname) contents (\ () !ev -> parseStep ev) ()
hPDB>    |
hPDB> 49 |   where parsing = do parsePDBRec (BS.pack fname) contents (\() !ev -> parseStep ev) ()
hPDB>    |                                                                       ^^^^^^^^^
hPDB> Bio/PDB/StructureBuilder/Internals.hs:145:47: error:
hPDB>     • No instance for (MonadFail (ST.ST t))
hPDB>         arising from a use of ‘finalize’
hPDB>     • In a stmt of a 'do' block: rf <- finalize rc
hPDB>       In the second argument of ‘($)’, namely
hPDB>         ‘do let Just res = r
hPDB>             rc <- gets residueContents
hPDB>             rf <- finalize rc
hPDB>             cc <- gets chainContents
hPDB>             ....’
hPDB>       In a stmt of a 'do' block:
hPDB>         when (isJust r)
hPDB>           $ do let Just res = r
hPDB>                rc <- gets residueContents
hPDB>                rf <- finalize rc
hPDB>                cc <- gets chainContents
hPDB>                ....
hPDB>     |
hPDB> 145 |                                        rf  <- L.finalize rc
hPDB>     |                                               ^^^^^^^^^^
hPDB> Bio/PDB/StructureBuilder/Internals.hs:160:45: error:
hPDB>     • No instance for (MonadFail (ST.ST t))
hPDB>         arising from a use of ‘finalize’
hPDB>     • In a stmt of a 'do' block: l' <- finalize l
hPDB>       In the second argument of ‘($)’, namely
hPDB>         ‘do l <- gets chainContents
hPDB>             l' <- finalize l
hPDB>             let Just ch = c
hPDB>                 ch' = ...
hPDB>             m <- gets currentModel
hPDB>             ....’
hPDB>       In a stmt of a 'do' block:
hPDB>         when (isJust c)
hPDB>           $ do l <- gets chainContents
hPDB>                l' <- finalize l
hPDB>                let Just ch = c
hPDB>                    ch' = ...
hPDB>                m <- gets currentModel
hPDB>                ....
hPDB>     |
hPDB> 160 |                                      l'  <- L.finalize l
hPDB>     |                                             ^^^^^^^^^^
hPDB> Bio/PDB/StructureBuilder/Internals.hs:185:19: error:
hPDB>     • No instance for (MonadFail (ST.ST t)) arising from a use of ‘add’
hPDB>     • In the first argument of ‘($)’, namely ‘add e’
hPDB>       In a stmt of a 'do' block: add e $ anError ln
hPDB>       In the expression:
hPDB>         do e <- gets errors
hPDB>            lnref <- gets lineNo
hPDB>            ln <- lift $ readSTRef lnref
hPDB>            lift $ modifySTRef lnref (+ 1)
hPDB>            ....
hPDB>     |
hPDB> 185 |                   L.add e $ anError ln
hPDB>     |                   ^^^^^
hPDB> Bio/PDB/StructureBuilder/Internals.hs:196:40: error:
hPDB>     • No instance for (MonadFail (ST.ST t))
hPDB>         arising from a use of ‘finalize’
hPDB>     • In a stmt of a 'do' block: chs <- finalize mc
hPDB>       In the expression:
hPDB>         do mc <- gets modelContents
hPDB>            chs <- finalize mc
hPDB>            let m' = ...
hPDB>            sc <- gets structureContents
hPDB>            ....
hPDB>       In a case alternative:
hPDB>           Just m
hPDB>             -> do mc <- gets modelContents
hPDB>                   chs <- finalize mc
hPDB>                   let m' = ...
hPDB>                   ....
hPDB>     |
hPDB> 196 |                                 chs <- L.finalize mc
hPDB>     |                                        ^^^^^^^^^^
hPDB> Bio/PDB/StructureBuilder/Internals.hs:208:28: error:
hPDB>     • No instance for (MonadFail (ST.ST t))
hPDB>         arising from a use of ‘finalize’
hPDB>     • In a stmt of a 'do' block: sc' <- finalize sc
hPDB>       In the expression:
hPDB>         do closeModel
hPDB>            sc <- gets structureContents
hPDB>            sc' <- finalize sc
hPDB>            modify (closeStructure' sc')
hPDB>       In an equation for ‘closeStructure’:
hPDB>           closeStructure
hPDB>             = do closeModel
hPDB>                  sc <- gets structureContents
hPDB>                  sc' <- finalize sc
hPDB>                  ....
hPDB>             where
hPDB>                 closeStructure' sc bstate@(BState {currentStructure = aStructure})
hPDB>                   = bstate
hPDB>                       {currentStructure = aStructure {models = sc},
hPDB>                        structureContents = undefined}
hPDB>     |
hPDB> 208 |                     sc' <- L.finalize sc
hPDB>     |                            ^^^^^^^^^^
hPDB> Bio/PDB/StructureBuilder/Internals.hs:285:25: error:
hPDB>     • No instance for (MonadFail (ST.ST t))
hPDB>         arising from a use of ‘finalize’
hPDB>     • In a stmt of a 'do' block: er' <- finalize er
hPDB>       In the expression:
hPDB>         do closeStructure
hPDB>            st <- gets currentStructure
hPDB>            er <- gets errors
hPDB>            er' <- finalize er
hPDB>            ....
hPDB>       In an equation for ‘parseFinish’:
hPDB>           parseFinish
hPDB>             = do closeStructure
hPDB>                  st <- gets currentStructure
hPDB>                  er <- gets errors
hPDB>                  ....
hPDB>     |
hPDB> 285 |                  er' <- finalize er
hPDB>     |                         ^^^^^^^^
hPDB> [56 of 60] Compiling Bio.PDB.Util.ParFold ( Bio/PDB/Util/ParFold.hs, dist/build/Bio/PDB/Util/ParFold.o, dist/build/Bio/PDB/Util/ParFold.dyn_o )
error: builder for '/nix/store/k2f4yrb2hrynpzxdxqyr7xfkcxj02g10-hPDB-1.5.0.0.drv' failed with exit code 1;
       last 10 log lines:
       >       In an equation for ‘parseFinish’:
       >           parseFinish
       >             = do closeStructure
       >                  st <- gets currentStructure
       >                  er <- gets errors
       >                  ....
       >     |
       > 285 |                  er' <- finalize er
       >     |                         ^^^^^^^^
       > [56 of 60] Compiling Bio.PDB.Util.ParFold ( Bio/PDB/Util/ParFold.hs, dist/build/Bio/PDB/Util/ParFold.o, dist/build/Bio/PDB/Util/ParFold.dyn_o )
       For full logs, run 'nix log /nix/store/k2f4yrb2hrynpzxdxqyr7xfkcxj02g10-hPDB-1.5.0.0.drv'.