In the "Single Digit Math" Chapter:
- Section "A Single Digit" (first code snippet):
module Data.Char should be replaced with
import Data.Char.
- Section "Adding Types":
The data type has a terminal type Num Int, but it is instantiated with a Char in isDigit x = Num x.
Either change the Num Int to Num Char or construct it with the ordinal value of the character: isDigit x = Num ((ord x)-(ord '0'))
Maybe not that important in general, but for someone not proficient in haskell like me, it took a while to find why the codes are not compiling.
In the "Single Digit Math" Chapter:
module Data.Charshould be replaced withimport Data.Char.The data type has a terminal type
Num Int, but it is instantiated with aCharinisDigit x = Num x.Either change the
Num InttoNum Charor construct it with the ordinal value of the character:isDigit x = Num ((ord x)-(ord '0'))Maybe not that important in general, but for someone not proficient in haskell like me, it took a while to find why the codes are not compiling.