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

Request: Add `infixl 0 !` #897

Closed
dterhorst opened this Issue Aug 14, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@dterhorst

dterhorst commented Aug 14, 2017

Platform

$ elm --version
0.18.0
$ uname -a
Darwin hexbox 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64

Steps to Reproduce

model
  |> Debug.log "model"
  ! []

Expected

Compiles. Equivalent to (model, Cmd.none).

Actual

Does not compile.

13|     model
14|>        |> Debug.log "model"
15|>        ! []

(|>) is expecting the right side to be a:

    b -> ( a -> a, Cmd msg )

But the right side is:

    ( a -> a, Cmd msg )

Hint: It looks like a function needs 1 more argument.

Hint: With operators like (|>) I always check the left side first. If it seems
fine, I assume it is correct and check the right side. So the problem may be in
how the left and right arguments interact.

Detected errors in 1 module.

elm-live:
  elm-make failed! You can find more info above. Keep calm
  and take your time to fix your code. We’ll try to compile it again
  as soon as you change a file.

Note

Adding infixl 0 ! seems to do the trick.

Without it, you need parens to make this work:

(model
  |> Debug.log "model"
)
  ! []

which seems ugly and unnecessary.

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Aug 14, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Aug 14, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@dterhorst

This comment has been minimized.

Show comment
Hide comment
@dterhorst

dterhorst Aug 14, 2017

Sounds like evancz already has a plan. 👍

I'll just declare it locally until I see what is in store in 0.19.

dterhorst commented Aug 14, 2017

Sounds like evancz already has a plan. 👍

I'll just declare it locally until I see what is in store in 0.19.

@dterhorst dterhorst closed this Aug 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment