elm-form
elm-form copied to clipboard
Example does not compile (Elm 0.19.1)
Here is the error:
elm-form$ cd example/
example$ elm make src/Main.elm --output main.js
Detected problems in 1 module.
-- TYPE MISMATCH ------------------------------------------------- src/Model.elm
This function cannot handle the argument sent through the (|>) pipe:
147| succeed Profile
148| |> andMap
149| (field "website"
150| (oneOf
151| [ emptyString |> map (\_ -> Nothing)
152| , validateUrl |> map Just
153| ]
154| )
155| )
156| |> andMap (field "role" (string |> andThen (includedIn roles)))
157| |> andMap (field "superpowers" validateSuperpower)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The argument is:
Field
-> Result
(Error.Error CustomError)
(List Superpower -> Int -> String -> Profile)
But (|>) is piping it to a function that expects:
Validation CustomError (Superpower -> b)
The code also seems not to be the code for the live demo (e.g. Model.initialFields has age = 33 and a list of todos).