Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Example does not compile (Elm 0.19.1) #119

Open
llaisdy opened this issue Feb 25, 2020 · 0 comments
Open

Example does not compile (Elm 0.19.1) #119

llaisdy opened this issue Feb 25, 2020 · 0 comments

Comments

@llaisdy
Copy link

llaisdy commented Feb 25, 2020

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant