Last active
March 21, 2017 21:38
-
-
Save mandubian/83d28f126ddf684eca633e809ba87fdd to your computer and use it in GitHub Desktop.
why this compile error?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mapAccumL : Traversable t => (a -> b -> (c, a)) -> a -> t b -> (t c, a) | |
mapAccumL f a1 tb = runState (traverse stateFlip tb) a1 | |
where | |
-- if I comment next line, it compiles OK | |
-- else it fails with : | |
-- | |
-- test.idr:91:37:When checking right hand side of test.mapAccumL, stateFlip with expected type | |
-- StateT a Identity c | |
-- When checking an application of f: | |
-- Type mismatch between | |
-- b1 (Type of b1) | |
-- and | |
-- b (Expected type) | |
stateFlip : b -> StateT a Identity c | |
stateFlip b1 = ST (\x => pure(f x b1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment