You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
saeednj
changed the title
Small bug in the haskell code snippets
Small bugs in the haskell code snippets
Jan 26, 2019
In the "Single Digit Math" Chapter:
module Data.Char
should be replaced withimport Data.Char
.The data type has a terminal type
Num Int
, but it is instantiated with aChar
inisDigit x = Num x
.Either change the
Num Int
toNum 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.
The text was updated successfully, but these errors were encountered: