Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse destructuring of function arguments #2

Closed
tunguski opened this issue Apr 17, 2017 · 2 comments
Closed

Cannot parse destructuring of function arguments #2

tunguski opened this issue Apr 17, 2017 · 2 comments

Comments

@tunguski
Copy link
Owner

tunguski commented Apr 17, 2017

Parser cannot destructure function arguments.

Basics.never case:

{-| A function that can never be called. Seems extremely pointless, but it
*can* come in handy. Imagine you have some HTML that should never produce any
messages. And say you want to use it in some other HTML that *does* produce
messages. You could say:

    import Html exposing (..)

    embedHtml : Html Never -> Html msg
    embedHtml staticStuff =
      div []
        [ text "hello"
        , Html.map never staticStuff
        ]

So the `never` function is basically telling the type system, make sure no one
ever calls me!
-}
never : Never -> a
never (JustOneMore nvr) =
  never nvr

Parser does not understand (JustOneMore nvr) in function declaration.

@tunguski
Copy link
Owner Author

Same case with Set.insert:

{-| Insert a value into a set.
-}
insert : comparable -> Set comparable -> Set comparable
insert k (Set_elm_builtin d) =
  Set_elm_builtin <| Dict.insert k () d

@tunguski
Copy link
Owner Author

Time.subMap

subMap : (a -> b) -> MySub a -> MySub b
subMap f (Every interval tagger) =
  Every interval (f << tagger)

@tunguski tunguski changed the title Basics.never does not parse Cannot parse destructuring of function arguments Apr 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant