Chapter 2 OutlineΒΆ
2.1 Hello, Haskell!
2.2 Interacting with Haskell code
2.2.1 Using the REPL
2.2.2 What is Prelude?
2.2.3 GHCi commands
2.2.4 Working from source files
2.3 Understanding expressions
2.3.1 Normal form
2.4 Functions
2.4.1 Defining functions
2.4.2 Capitalization matters!
2.4.3 Playing with the triple function
2.5 Evaluation
2.5.1 Exercises: Comprehension check
1
2
3
2.6 Infix operators
2.6.1 Associativity and precedence
2.6.2 Exercises: Parentheses and association
1
a
b
2
a
b
3
a
b
2.7 Declaring values
2.7.1 Troubleshooting
2.7.2 Exercises: Heal the sick
1
2
3
2.8 Arithmetic functions in Haskell
2.8.1 Laws for quotients and remainders
2.8.2 Using mod
2.9 Parenthesization
2.9.1 Parenthesizing infix operators
2.10 let and where
2.10.1 Exercises: A head code
Determine what the following expressions will return.
1
2
3
4
Rewrite the where clauses.
1
2
3
2.11 Chapter exercises
2.11.1 Parenthesization
1
2
3
2.11.2 Equivalent expressions
1
2
3
4
5
2.11.3 More fun with functions
1
2
3
4
5
6
7
2.12 Definitions
Parameter
Expression
Value
Function
Infix notation
Operators
Syntactic sugar
2.13 Follow-up resources
Haskell Wiki. Let vs Where. https://wiki.haskell.org/Let_vs._Where
Gabriel Gonzalez. How to desugar Haskell code.