mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-09-10 13:05:24 +02:00
17 lines
960 B
TeX
17 lines
960 B
TeX
\subsection{The bad news: The syntax}
|
|
In short: It's quite bad, but you will get used to it and some of the (arguably) poor looking syntax choices will start to make more sense.
|
|
|
|
You should use 2 space indents (yuck) and indents matter, just like in Python.
|
|
|
|
We can use binary functions in infix or prefix notation, i.e. \texttt{x `mod` z} and \texttt{mod x z} are equivalent.
|
|
|
|
For integers the following functions are available: Normal arithmetic operations \texttt{+, -, *, /, mod, abs}, as well as \texttt{\^} which is used for exponentiation.
|
|
|
|
To use prefix notation on non-alphanumeric function names, wrap them in parenthesis like this: \texttt{(+) x z}. Using \texttt{+ x z} does not work.
|
|
|
|
We can use the normal comparison operators that return a boolean on evaluation. \bi{Booleans} are \texttt{True} and \texttt{False}
|
|
|
|
|
|
\subsection{Book}
|
|
Since the Haskell Book recommended by the lecture is concise and really great, we recommend reading that book.
|