Skip to content

Instantly share code, notes, and snippets.

@DarinM223
Created November 25, 2016 07:05
Show Gist options
  • Save DarinM223/35fa7335cd850c7ff22430038746fc21 to your computer and use it in GitHub Desktop.
Save DarinM223/35fa7335cd850c7ff22430038746fc21 to your computer and use it in GitHub Desktop.
Haskell errors
main.hs:71:5: error:
• Couldn't match type ‘t0 ((->) Int)’ with ‘IO’
Expected type: IO (State GameState ())
Actual type: t0 ((->) Int) (State GameState ())
• In a stmt of a 'do' block: lift dealCards
In the expression:
do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
lift $ handlePlayers players }
In an equation for ‘run’:
run
= do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
.... }
where
handlePlayers (p : ps)
= do { action <- decideAction p;
.... }
handlePlayers [p]
= do { action <- decideAction p;
.... }
main.hs:72:16: error:
• Couldn't match type ‘t1 (StateT
GameState Data.Functor.Identity.Identity)’
with ‘IO’
Expected type: IO [Player]
Actual type: t1 (StateT
GameState Data.Functor.Identity.Identity) [Player]
• In a stmt of a 'do' block: players <- lift getPlayers
In the expression:
do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
lift $ handlePlayers players }
In an equation for ‘run’:
run
= do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
.... }
where
handlePlayers (p : ps)
= do { action <- decideAction p;
.... }
handlePlayers [p]
= do { action <- decideAction p;
.... }
main.hs:73:15: error:
• Couldn't match type ‘t2 (StateT
GameState Data.Functor.Identity.Identity)’
with ‘IO’
Expected type: IO Dealer
Actual type: t2 (StateT
GameState Data.Functor.Identity.Identity) Dealer
• In a stmt of a 'do' block: dealer <- lift getDealer
In the expression:
do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
lift $ handlePlayers players }
In an equation for ‘run’:
run
= do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
.... }
where
handlePlayers (p : ps)
= do { action <- decideAction p;
.... }
handlePlayers [p]
= do { action <- decideAction p;
.... }
main.hs:74:5: error:
• Couldn't match type ‘t3 IO’ with ‘IO’
Expected type: IO (State GameState ())
Actual type: t3 IO (State GameState ())
• In a stmt of a 'do' block: lift $ handlePlayers players
In the expression:
do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
lift $ handlePlayers players }
In an equation for ‘run’:
run
= do { lift dealCards;
players <- lift getPlayers;
dealer <- lift getDealer;
.... }
where
handlePlayers (p : ps)
= do { action <- decideAction p;
.... }
handlePlayers [p]
= do { action <- decideAction p;
.... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment