1.5

Conventions Used in This Book

Most conventions used in the book should be self-explanatory. Listed below are some that might be a bit confusing.

Terminal

We will be using the term terminal throughout the book to mean a program that lets you type and execute textual commands. If you come from Unix background, this term should already be familiar to you. But, if you come from Windows background, you can mentally replace it with command prompt.

Unix refers to a family of operating systems that includes macOS and Linux.

Commands

This book presents many commands that are run from the terminal. For simplicity, all command examples omit the $ sign (on Unix) and > sign (on Windows). This also makes it easier to copy the commands. Here’s an example:

elm --version

Although, when we’re inside elm-repl, the > sign is shown on both Unix and Windows systems to indicate that the code is meant to be entered into an elm-repl session. Here’s an example:

> 1 + 2
3 : number

Vertical Pipes

When entering multi-line code, elm-repl adds pipes (|) in-front of each line starting from the second line. You shouldn’t type these pipes literally. Here’s an example:

> if velocity > 11.186 then \
|   "Godspeed" \
| else if speed == 7.67 then \
|   "Stay in orbit" \
| else \
|   "Come back"
"Stay in orbit"

Two Vertical Dots

Many code examples in the book include two vertical dots to omit a big chunk of code not relevant to the topic being discussed. You shouldn’t type these dots literally. Here are some examples:

import Html exposing (text)
.
.

main =
    isEmpty list2
        |> toString
        |> text
{
    .
    .
    "source-directories": [
        ".",
        "elm-examples"
    ],
    .
    .
}

Three Horizontal Dots

Three horizontal dots are used to omit the body of a function. Again, you shouldn’t type them literally. Here is an example:

list2 =
    MyList.Node 9 MyList.Empty


main =
    ...

Two Horizontal Dots

When defining a module, the two horizontal dots (..) have special meaning in Elm. You should definitely type them literally. Here’s an example:

module Playground exposing (..)

We will cover modules in detail in chapter 4.

Back to top

New chapters are coming soon!

Sign up for the Elm Programming newsletter to get notified!

* indicates required
Close