Closed jgcoded closed 9 years ago
That'll be because I haven't tested it with anything other than GHC 7.10. Should be an easy fix.
I'm using GHC 7.8.3 obtained from https://www.haskell.org/platform/. It doesn't provide GHC 7.10, unfortunately.
There we go, I think it should compile now unless there's anything else I've missed.
What version of lens do you have? The error is slightly different:
src\Game\Robo\Core.hs:82:29:
Not in scope: `<$>'
Perhaps you meant `<>' (imported from Control.Monad.Writer.Strict)
Sorry, that first time didn't fix it because I merged the change into a local branch instead of the one that was pushed to GitHub. I pushed an actual fix about 30 minutes ago. That error has nothing to do with lens -- <$>
is from Control.Applicative
(but it's in Prelude
for GHC 7.10).
I now get this:
src\Game\Robo\Core.hs:83:29:
Could not deduce (Functor m) arising from a use of `<$>'
from the context (Monad m)
bound by the type signature for
applyAllBots :: Monad m =>
[ContextT BotState m a] -> ContextT WorldState m [a]
at src\Game\Robo\Core.hs:79:17-79
Possible fix:
add (Functor m) to the context of
the type signature for
applyAllBots :: Monad m =>
[ContextT BotState m a] -> ContextT WorldState m [a]
In a stmt of a 'do' block:
(res, newStates) <- unzip <$> zipWithM runfun bots botStates
In the expression:
do { botStates <- use wldBots;
let runfun action st = lift $ runStateT action st;
(res, newStates) <- unzip <$> zipWithM runfun bots botStates;
wldBots .= newStates;
.... }
In an equation for `applyAllBots':
applyAllBots bots
= do { botStates <- use wldBots;
let runfun action st = ...;
(res, newStates) <- unzip <$> zipWithM runfun bots botStates;
.... }
I'll upgrade to 7.10 and try it again
That should be fixed now too hopefully!
If you do want to try it with GHC 7.10, I'd recommend installing stack.
So that part of Core finally built! Now it's complaining in the examples. Crazy and Wallhugger compile, but I get this now:
demo\BulletTester.hs:56:22: Not in scope: `<$>'
I'll switch to stack, it looks easier than cabal.
Please tell me it works now? :P
Yes! All good now. Thank you!
I tried to build the most current master (3e81ff1805e870d773af5dfd4a0422f510559091), but I received this error: