<commit_before>
# Core Language

This section will walk you through Elm's simple core language. The aim is to build a strong understanding of the basics so you have a good foundation when you start working with graphics and interactivity.

To follow along [get everything installed](/install) and start up `elm repl` in the terminal. It should look like this:

```haskell
Elm REPL 0.4.1 (Elm Platform 0.15)
  See usage examples at <https://github.com/elm-lang/elm-repl>
  Type :help for help, :exit to exit
>
```

The REPL will print out the type of the result, but for the sake of introducing concepts gradually, we will leave them out in the REPL examples in this section.

We will cover [values](#values), [functions](#functions), [lists](#lists), [tuples](#tuples), and [records](#records) which all correspond pretty closely with structures in languages like JavaScript, Python, and Java.


## Values

Let's get started with some strings:

```haskell
> "hello"
"hello"

> "hello" ++ "world"
"helloworld"

> "hello" ++ " world"
"hello world"
```

Elm uses the `(++)` operator to put strings together. Notice that both strings are preserved exactly as is when they are put together so when we combine `"hello"` and `"world"` the result has no spaces.

Math looks pretty normal too:

```haskell
> 2 + 3 * 4
14

> (2 + 3) * 4
20
```

Unlike JavaScript, Elm makes a distinction between integers and floating point numbers, so similar to Python, there is both floating point division `(/)` and integer division `(//)`.

```haskell
> 9 / 2
4.5

> 9 // 2
4
```

## Functions

Lets start by writing a function `isNegative` that takes in some number and checks if it is less than zero. This will result will be `True` or `False`.

```haskell
> isNegative n = n < 0
<function><commit_msg>Fix typos<commit_after>
# Core Language

This section will walk you through Elm's simple core language. The aim is to build a strong understanding of the basics so you have a good foundation when you start working with graphics and interactivity.

To follow along [get everything installed](/install) and start up `elm repl` in the terminal. It should look like this:

```haskell
Elm REPL 0.4.1 (Elm Platform 0.15)
  See usage examples at <https://github.com/elm-lang/elm-repl>
  Type :help for help, :exit to exit
>
```

The REPL will print out the type of the result, but for the sake of introducing concepts gradually, we will leave them out in the REPL examples in this section.

We will cover [values](#values), [functions](#functions), [lists](#lists), [tuples](#tuples), and [records](#records) which all correspond pretty closely with structures in languages like JavaScript, Python, and Java.


## Values

Let's get started with some strings:

```haskell
> "hello"
"hello"

> "hello" ++ "world"
"helloworld"

> "hello" ++ " world"
"hello world"
```

Elm uses the `(++)` operator to put strings together. Notice that both strings are preserved exactly as is when they are put together so when we combine `"hello"` and `"world"` the result has no spaces.

Math looks pretty normal too:

```haskell
> 2 + 3 * 4
14

> (2 + 3) * 4
20
```

Unlike JavaScript, Elm makes a distinction between integers and floating point numbers, so similar to Python, there is both floating point division `(/)` and integer division `(//)`.

```haskell
> 9 / 2
4.5

> 9 // 2
4
```

## Functions

Let's start by writing a function `isNegative` that takes in some number and checks if it is less than zero. The result will be `True` or `False`.

```haskell
> isNegative n = n < 0
<function>
{'fraction_non_alphanumeric': 0.10436005625879044, 'fraction_numerical': 0.01350210970464135, 'mean_word_length': 4.176128093158661, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5882354', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1006, 'n_words': 521}