In the docs on the front page, you have the following:
main :: Effect Unit
main = do
H.mount "main" {
init: init :> [],
update: \msg model -> update msg model :> [],
view
}
The type signature for update is as follows:
update :: Model -> Msg -> Model
It appears that the arguments to your anonymous function have the names reversed. Am I missing something?
> type Model = Int
> data Msg = Increment | Decrement
… update :: Model -> Msg -> Model
… update model = case _ of
… Increment -> model + 1
… Decrement -> model - 1
…
> u = \msg model -> update msg model
> r1 = u Increment 0
Error found:
in module $PSCI
at :1:8 - 1:17 (line 1, column 8 - line 1, column 17)
Could not match type
Msg
with type
Int
> r1 = u 0 Increment
-- Works fine...
In the docs on the front page, you have the following:
The type signature for update is as follows:
It appears that the arguments to your anonymous function have the names reversed. Am I missing something?