4The REPL lets you interact with Elm values and functions in your terminal.
9You can type in expressions, definitions, custom types, and module imports using normal Elm syntax.
19The same can be done with definitions and custom types:
26<function> : number -> number
37<function> : number -> number
47> case Regular "Tom" of
48| Regular name -> "Hey again!"
49| Visitor name -> "Nice to meet you!"
54When you run `elm repl` in a project with an [`elm.json`](https://github.com/elm/compiler/blob/master/docs/elm.json/application.md) file, you can import any module available in the project. So if your project has an `elm/html` dependency, you could say:
57> import Html exposing (Html)
63<function> : String -> Html msg
66If you create a module in your project named `MyThing` in your project, you can say `import MyThing` in the REPL as well. Any module that is accessible in your project should be accessible in the REPL.
71To exit the REPL, you can type `:exit`.
73You can also press `ctrl-d` or `ctrl-c` on some platforms.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list