haskell - Typechecking problems with pipes-attoparsec -
i've been trying out pipes-attoparsec haven't been having luck.
it appears there type mismatch between void , x in (what seems be) relatively straightforward code. i've read in library (that type synonym @ point), i'm not sure how interpret type error.
test code:
{-# language overloadedstrings,rankntypes #-} module main import qualified data.attoparsec.char8 import qualified pipes p import qualified pipes.attoparsec pa import qualified pipes.bytestring pb import qualified pipes.parse pp passthrough :: a.parser pb.bytestring passthrough = a.takewhile (\s->true) f :: monad m => pp.statet (p.producer pb.bytestring m r) m (either string string) f = r <- pa.parse passthrough return $ case r of left e -> left "a" right (_,r1) -> right "b" g = pp.evalstatet f pb.stdin h = p.runeffect g
this results in error:
p.hs:16:8: couldn't match type `pipes-4.0.2:pipes.internal.proxy data.void.void () () pb.bytestring m r0' `p.proxy p.x () () pb.bytestring m r' expected type: pp.statet (pp.producer pb.bytestring m r) m (either pa.parsingerror (int, pb.bytestring)) actual type: pp.statet (pipes-4.0.2:pipes.core.producer pb.bytestring m r0) m (either pa.parsingerror (int, pb.bytestring)) in return type of call of `pa.parse' in stmt of 'do' block: r <- pa.parse passthrough in expression: { r <- pa.parse passthrough; return $ case r of { left e -> left "a" right (_, r1) -> right "b" } } failed, modules loaded: none.
you need upgrade latest pipes-attoparsec
, restricts pipes
dependency 4.1.*
. can give more detailed information how might have arisen if list versions have installed pipes
, pipes-parse
, , pipes-attoparsec
. if type ghc-pkg list | grep pipes
should enough.
Comments
Post a Comment