1 :l myfunctions <span class="co1">--load the functions in the file myfunctions.hs</span>
2 :r <span class="co1">--reload</span>
3 <span class="nu0">1</span> <span class="sy0">/=</span> <span class="nu0">0</span> <span class="co1">--not equal</span>
4 <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:succ"><span class="kw3">succ</span></a> <span class="nu0">0</span> <span class="sy0">==</span> <span class="nu0">1</span> <span class="co1">--successor</span>
5 <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:min"><span class="kw3">min</span></a> <span class="nu0">1</span> <span class="nu0">2</span> <span class="sy0">==</span> <span class="nu0">1</span> <span class="co1">--minimum</span>
6 <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:max"><span class="kw3">max</span></a> <span class="nu0">1</span> <span class="nu0">2</span> <span class="sy0">==</span> <span class="nu0">2</span> <span class="co1">--maximum</span>
7 <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:div"><span class="kw3">div</span></a> 2 1 <span class="sy0">==</span> 2 '<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:div"><span class="kw3">div</span></a>' <span class="nu0">1</span> <span class="co1">--infix notation</span>
8 mysucc x <span class="sy0">=</span> x <span class="sy0">+</span> <span class="nu0">1</span> <span class="co1">--function definition</span>
9 <span class="br0">[</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="br0">]</span> <span class="sy0">==</span> <span class="nu0">1</span>:<span class="nu0">2</span>:<span class="br0">[</span><span class="br0">]</span> <span class="co1">--list definition</span>
10 <span class="br0">[</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="br0">]</span> <span class="sy0">++</span> <span class="br0">[</span><span class="nu0">3</span><span class="sy0">,</span> <span class="nu0">4</span><span class="br0">]</span> <span class="sy0">==</span> <span class="br0">[</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="sy0">,</span> <span class="nu0">3</span><span class="sy0">,</span> <span class="nu0">4</span><span class="br0">]</span> <span class="co1">--list concatenation</span>
11 <span class="br0">[</span>'a'<span class="sy0">,</span> 'b'<span class="br0">]</span> <span class="sy0">!!</span> <span class="nu0">1</span> <span class="sy0">==</span> 'b' <span class="co1">--list indexing</span>