Do not enable -XBangPatterns by default
Here is an example which fails to parse with bang patterns but succeeds
otherwise:
(!) :: Foo -> Int -> Int
(Foo n) ! p = n + p
To run Ormolu on this we must not enable bang patterns by default.
commite5d197fed997ffe0e97dadd845427dcafc2cb4de
authormrkkrp <mark.karpov@tweag.io>
dateTue 10 Sep 2019, 15:23 (7 years ago)
parent1e14f9f
data/examples/declaration/value/function/lambda-single-line-out.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE BangPatterns #-}
2+
13foo :: a -> a -> a
24foo x = \y -> x
35
data/examples/declaration/value/function/lambda-single-line.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE BangPatterns #-}
2+
13foo :: a -> a -> a
24foo x = \y -> x
35
data/examples/declaration/value/function/pattern/strictness-out.hs+2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE BangPatterns #-}
2+
13!a = ()
24
35~b = ()
data/examples/declaration/value/function/pattern/strictness.hs+2
@@ -1,2 +1,4 @@
1+{-# LANGUAGE BangPatterns #-}
2+
13!a = ()
24~b = ()
src/Ormolu/Parser.hs+1
@@ -76,6 +76,7 @@ manualExts :: [Extension]
7676manualExts =
7777 [ Arrows -- steals proc
7878 , Cpp -- forbidden
79+ , BangPatterns -- makes certain patterns with ! fail
7980 , PatternSynonyms -- steals the pattern keyword
8081 , RecursiveDo -- steals the rec keyword
8182 , StaticPointers -- steals static keyword