Open LambdaP opened 5 years ago
I have tested compiling stylish-haskell against haskell-src-exts-1.21.0, but the bug remains. If I find the time I will dig into haskell-src-exts directly.
The following config file will work around this and related issues, without forcing a workaround to your main haskell source code:
steps:
- simple_align: {}
- imports: {}
- language_pragmas: {}
- trailing_whitespace: {}
language_extensions:
- FlexibleContexts # stylish-haskell bug, see jaspervdj/stylish-haskell#230
- MultiParamTypeClasses # stylish-haskell bug, see jaspervdj/stylish-haskell#103 and haskell-suite/haskell-src-exts#304
The following piece of code (essentially a modified snippet from Thinking with Types by Sandy Maguire) compiles and runs fine (GHC 8.6.3 on macOS 10.14.2 installed with Stack using lts-13.4).
However, stylish-haskell (0.9.2.1) won’t parse it unless -XFlexibleContexts is active:
Adding the pragma
{-# LANGUAGE FlexibleContexts #-}
makes stylish-haskell behave as expected, but it’s unsatisfying.Given this comment, I realize that the issue may not be with stylish-haskell itself. I’ll investigate.