elm-repl icon indicating copy to clipboard operation
elm-repl copied to clipboard

Can't define new operators in REPL

Open jasalo opened this issue 8 years ago • 2 comments

I'm trying to build a new simple dummy operator such as:

(**) x y = x ^ y

And I've tried with different symbols, but it's always giving me this error:

-- SYNTAX PROBLEM -------------------------------------------- repl-temp-000.elm

I ran into something unexpected when parsing your code!

4|   **
     ^
I am looking for one of the following things:

    an expression
    whitespace

I've also tried with the very example from the Elm Syntax documentation page and it doesn't work:

(?) : Maybe a -> a -> a
(?) maybe default =
  Maybe.withDefault default maybe

Is there a reason why defining new operators on the REPL is currently not possible?

jasalo avatar Dec 01 '16 01:12 jasalo

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 avatar Dec 01 '16 01:12 process-bot

+1. I need this too, for explaining grammar.

Your link above is wrong. Fix => http://elm-lang.org/docs/syntax.

jinjor avatar Jan 07 '17 09:01 jinjor