stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

Support for EmptyCase

Open chris-martin opened this issue 7 years ago • 3 comments

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: }"

chris-martin avatar Feb 17 '17 03:02 chris-martin

:+1: came here to report this. I suspect this is because haskell-src-exts doesn't support this extension?

osa1 avatar Feb 25 '17 19:02 osa1

{-# LANGUAGE EmptyCase #-} doesn't work but if I add EmptyCase to .stylish-haskell it parses fine.

osa1 avatar Feb 25 '17 19:02 osa1

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.

neongreen avatar Apr 16 '17 00:04 neongreen