mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-03-14 10:50:05 +01:00
18 lines
1.3 KiB
TeX
18 lines
1.3 KiB
TeX
Haskell is a functional programming language. As such, its functions can be thought of as being similar to mathematical functions and as such are side-effect-free.
|
|
|
|
Haskell's type system is very robust and an interesting topic to learn about.
|
|
The basic data types you already know from other programming languages are also present here. This includes all primitives like integers, floating point numbers, chars and booleans.
|
|
|
|
Strings are handled similarly to how \texttt{C} does it, in that strings are char arrays.
|
|
|
|
Arrays however are dynamic length in Haskell as opposed to many other statically typed programming languages.
|
|
|
|
Since Haskell is an imperative language (i.e. you describe \textit{what} you want achieve)
|
|
as opposed to a declarative language (i.e. you describe \textit{how} you achieve what you want to achieve), there are no loops in Haskell,
|
|
as loops don't appear in mathematical formulas and functions either.
|
|
What we can do however is recursion and this is the main way of doing iterative work in Haskell.
|
|
|
|
Additionally, Haskell features \textit{lazy evaluation} (i.e. statements are evaluated only as needed) as opposed to \textit{eager evaluation} (i.e. statemetns are evaluated immediately).
|
|
|
|
In this course the \texttt{Glasgow Haskell Compiler}, short \texttt{ghc} is used. Installation is really easy (as long as you're on Linux)
|