Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small bugs in the haskell code snippets #4

Open
saeednj opened this issue Jan 26, 2019 · 0 comments
Open

Small bugs in the haskell code snippets #4

saeednj opened this issue Jan 26, 2019 · 0 comments

Comments

@saeednj
Copy link

saeednj commented Jan 26, 2019

In the "Single Digit Math" Chapter:

  1. Section "A Single Digit" (first code snippet):
    module Data.Char should be replaced with
    import Data.Char.
  2. 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.

@saeednj saeednj changed the title Small bug in the haskell code snippets Small bugs in the haskell code snippets Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant