The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Mark Elston (133) [Avatar] Offline
In the source zip file for lesson 38 I tried using stack ghci to start ghci and got the following error

GHCi, version 8.0.1:  :? for help
[1 of 2] Compiling Head             ( D:\Projects\Test\Haskell\Get Programming With Haskell\unit7\headaches\src\Head.lhs, interpreted )

D:\Projects\Test\Haskell\Get Programming With Haskell\unit7\headaches\src\Head.lhs:209:10: error:
    Not in scope: data constructor `InvalidValue'
    Perhaps you meant `InvalidValueo' (line 203)
Failed, modules loaded: none.

<no location info>: error:
    Could not find module `Head'
    It is not a module in the current program, or in any known package.
Loaded GHCi configuration from C:\Users\mark.elston\AppData\Local\Temp\ghci16368\ghci-script

When I looked at the files in the src directory I saw that instead of Head.hs there was a Head.lhs file. So far, I haven't been able to find out how to make use of the lhs file directly, though, apparently, stack seems to know what to do with it. But we are getting an error on compilation. It looks like there is a typo in the file. On line 203 you have:

>data PrimeError = TooLarge | InvalidValueo

There is an extra 'o' at the end of the line. Getting rid of that fixes the problem.