stylish-haskell
stylish-haskell copied to clipboard
Support for EmptyCase
With -XEmptyCase
, this is a valid expression:
\case{}
Stylish-haskell 0.7.1.0 fails on it.
Language.Haskell.Stylish.Parse.parseModule: could not parse foo.hs: ParseFailed (SrcLoc "
.hs" 195 23) "Parse error: }"
:+1: came here to report this. I suspect this is because haskell-src-exts
doesn't support this extension?
{-# LANGUAGE EmptyCase #-}
doesn't work but if I add EmptyCase
to .stylish-haskell
it parses fine.
With haskell-src-exts-1.19.1 everything works just fine (you need LambdaCase
as well, though):
{-# LANGUAGE EmptyCase, LambdaCase #-}
x = \case{}
I can confirm that the standard build (with hse-1.18) can't parse it, so my advice would be to install stylish-haskell
from Hackage or to override the haskell-src-exts choice in stack.yaml
when building stylish-haskell with Stack.