elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

(=>) = (,) throws error in REPL, but works in architecture tutorial #110

Open brobrts opened 8 years ago

brobrts commented 8 years ago

This works in the architecture examples - (=>) = (,) - but gets the following error in the tutorials.

(=>) = (,) -- 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
jvoigtlaender commented 8 years ago

Having looked a bit into it, I think the repl simply is restricted to only accept definitions of the form

functionName args = ...

with an actual function name string in that first place. (It's how bindings are organized in the repl implementation in this repository: as mappings from strings to definitions.)

No other ways that are possible for defining stuff in Elm code are supported in the repl. The issue here is like https://github.com/elm-lang/elm-repl/issues/68.