Haskell: purely functional programming language, which means functions in Haskell do not have side-effect.
- Pure function vs impure: i) it does not have any observable side-effects (like output to device, changing a mutable object) and, ii) it doesn’t change when passed the same parameter (random is impure, date() which returns current time is impure…) Lazy evaluation: avoids evaluation anything until the actual value is needed.
- Learn Haskell in 10 minutes
- Try haskell: try haskell online
- Haskell Wiki: Foundation of Haskell
- Haskell has 2 popular implementations: Hugs – interpreter used for teaching. GHC (Glasgow): it compiles to native code, provides debugging tools, supports parallel execution. ghc (compiler), ghci (interpreter), runghc (run ghc as script).
- /= (which is !=),
- numbers are not convertible to True and False,
- enumeration notation [1..10]
[3,1,3] ++ [3,7] -> [3,1,3,3,7]
1 : [2,3] -> [1,2,3]
- text string is a list of individual characters
x :: y–> “the expression
xhas the type
-> show type of x
- — lines beginning with “–” are comments.