Why does
let mbMove = case playerType of
Person _ -> do
Nothing
Computer strategy -> do
case strategy of
RandomPick -> do
let moves = ...
randN <- H.liftEff $ randomInt 0 $ length moves - 1
index moves randN
...
give compiler error on liftEff
:
No type class instance was found for
Control.Monad.Eff.Class.MonadEff ( random :: RANDOM
| t2
)
Maybe
but yet, this makes it happy:
RandomPick -> do
let moves = ...
head moves
???