Created
October 12, 2014 01:17
-
-
Save joshcough/ed53aed90353e233522c to your computer and use it in GitHub Desktop.
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
src/L/Computer.hs:163:23: | |
Could not deduce (m ~ ErrorT Halt m0) | |
from the context (MonadError Halt m, | |
MonadState c m, | |
HasComputer c a) | |
bound by the type signature for | |
readMem :: (MonadError Halt m, MonadState c m, HasComputer c a) => | |
String -> Int64 -> m Int64 | |
at src/L/Computer.hs:162:12-93 | |
‘m’ is a rigid type variable bound by | |
the type signature for | |
readMem :: (MonadError Halt m, MonadState c m, HasComputer c a) => | |
String -> Int64 -> m Int64 | |
at src/L/Computer.hs:162:12 | |
Expected type: m Int64 | |
Actual type: ErrorT Halt m0 Int64 | |
Relevant bindings include | |
go :: ErrorT Halt m0 Int64 (bound at src/L/Computer.hs:165:3) | |
readMem :: String -> Int64 -> m Int64 | |
(bound at src/L/Computer.hs:163:1) | |
In the expression: go | |
In an equation for ‘readMem’: | |
readMem caller addr | |
= go | |
where | |
index = fromIntegral addr `div` 8 | |
go | |
| index < memSize = use $ singular $ memory . ix index | |
| otherwise | |
= exception | |
$ caller | |
++ "tried to access out of bounds memory index: " ++ show index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment