Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let bGameState :: Behavior t GameState
- bGameState = accumB initialGS $ updateGS <$ eInput
- yields the error
- Couldn't match expected type `GameState'
- with actual type `PlayerCommand'
- Expected type: GameState -> GameState
- Actual type: PlayerCommand -> GameState -> GameState
- In the first argument of `(<$)', namely `updateGS'
- In the second argument of `($)', namely `updateGS <$ eInput'
- Could not deduce (t ~ t1)
- from the context (Frameworks t)
- bound by a type expected by the context:
- Frameworks t => Moment t ()
- at outline.hs:(153,42)-(159,93)
- `t' is a rigid type variable bound by
- a type expected by the context: Frameworks t => Moment t ()
- at outline.hs:153:42
- `t1' is a rigid type variable bound by
- the type signature for bGameState :: Behavior t1 GameState
- at outline.hs:158:8
- Expected type: Behavior t1 GameState
- Actual type: Behavior t GameState
- In the expression: accumB initialGS $ updateGS <$> eInput
- In an equation for `bGameState':
- bGameState = accumB initialGS $ updateGS <$> eInput
- makeNetworkDescription :: AddHandler PlayerCommand -> IO EventNetwork
- makeNetworkDescription addCommandEvent = compile $ do
- eInput <- fromAddHandler addCommandEvent
- let bCommand = stepper Null eInput
- eCommandChanged <- changes bCommand
- let bGameState :: Behavior t GameState
- bGameState = accumB initialGS $ updateGS <$> eInput
- reactimate $ (n -> appendFile "output.txt" ("Command is " ++ show n)) <$>
- eCommandChanged
- (<$) :: a -> f b -> f a
- updateGS :: PlayerCommand -> GameState -> GameState
- eInput :: Event t PlayerCommand
- a ~ PlayerCommand -> GameState -> GameState
- f b ~ Event t PlayerCommand
- f ~ Event t
- b ~ PlayerCommand
- f a ~ Event t (PlayerCommand -> GameState -> GameState)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement