qfpl / applied-fp-course

Applied Functional Programming Course - Move from exercises to a working app!
http://qfpl.io/projects/professional-fp-courses/
Other
625 stars 180 forks source link

Haddock generation fails with : src/Level04/Types.hs:42:1-6: error: parse error on input ‘import’ #77

Closed ericdwhite closed 5 years ago

ericdwhite commented 5 years ago

Note the code does not compile on a freash checkout of master.

This is the first error of a few. I think this is difficult for begineers because they are starting at Level01 and the whole project doesn't compile. So you have to sort that out first, the start with Level01.

$ cabal new-build
...
...
...
src/Level04/Types.hs:42:1-6: error: parse error on input ‘import’
   |
42 | import           Level04.Types.CommentText  (CommentText, getCommentText,
   | ^^^^^^
Warning: Failed to build documentation for applied-fp-course-0.1.0.0 (which is
required by exe:level07-exe from applied-fp-course-0.1.0.0, exe:level06-exe
from applied-fp-course-0.1.0.0 and others).
applied-fp-course (master)>

Cabal Version:

applied-fp-course (master)> cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library

GHC Version:

OSX

applied-fp-course (master)> ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.4.3
ericdwhite commented 5 years ago

I recompiled the world on 8.6.3 and it's the same. However this might not matter if you: cabal new-build level02-exe or cabal new-repl applied-fp-course

mankyKitty commented 5 years ago

I can only reproduce this if I explicitly try to generate the haddock documentation (cabal new-haddock) for the course. Which was never intended to be generated.

The course has a CI configuration that builds against multiple versions of GHC using both stack and cabal so a build failure like this would have been caught.

The error message states:

Warning: Failed to build documentation for applied-fp-course-0.1.0.0 (which i

My hunch would be that you've got some configuration somewhere that has globally enabled documentation generation.

https://www.haskell.org/cabal/users-guide/nix-local-build.html#cfg-field-documentation

I'll see about disabling documentation generation in the cabal.project.