sdiehl / write-you-a-haskell

Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)
MIT License
3.34k stars 256 forks source link

build with -XFlexibleContexts to make GHC 8.0.2 happy #97

Closed jahaynes closed 6 years ago

jahaynes commented 7 years ago

This is a workaround for:

Lexer.x:66:3: error:
    • Non type-variable argument in the constraint: MonadError [Char] m
      (Use FlexibleContexts to permit this)
    • When checking the inferred type
        go :: forall (m :: * -> *).
              MonadError [Char] m =>
              AlexInput -> m [Token]
      In an equation for ‘scanTokens’:
          scanTokens str
            = go ('\n', [], str)
            where
                go inp@(_, _bs, str)
                  = case alexScan inp 0 of {
                      AlexEOF -> return ...
                      AlexError _ -> throwError "Invalid lexeme."
                      AlexSkip inp' len -> go inp'
                      AlexToken inp' len act -> ... }
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1