on master help sign in
Output multiple specialize pragmas in a row nicer
656d036mrkkrp
data/examples/declaration/signature/specialize/specialize-out.hs+1
@@ -1,6 +1,7 @@
1foo :: Num a => a -> a
1foo :: Num a => a -> a
2foo = id
2foo = id
3{-# SPECIALIZE foo :: Int -> Int #-}
3{-# SPECIALIZE foo :: Int -> Int #-}
4+{-# SPECIALIZE foo :: Float -> Float #-}
4
5
5{-# SPECIALIZE [2] bar :: Int -> Int #-}
6{-# SPECIALIZE [2] bar :: Int -> Int #-}
6bar :: Num a => a -> a
7bar :: Num a => a -> a
data/examples/declaration/signature/specialize/specialize.hs+1
@@ -2,6 +2,7 @@ foo :: Num a => a -> a
2foo = id
2foo = id
3
3
4{-# SPECIALIZE foo :: Int -> Int #-}
4{-# SPECIALIZE foo :: Int -> Int #-}
5+{-# SPECIALIZE foo :: Float -> Float #-}
5
6
6{-# SPECIALIZE [2] bar :: Int -> Int #-}
7{-# SPECIALIZE [2] bar :: Int -> Int #-}
7
8
src/Ormolu/Printer/Meat/Module.hs+1
@@ -70,6 +70,7 @@ separatedDecls (FunctionBody n) (InlinePragma n') = n /= n'
70separatedDecls (InlinePragma n) (TypeSignature n') = n /= n'
70separatedDecls (InlinePragma n) (TypeSignature n') = n /= n'
71separatedDecls (FunctionBody n) (SpecializePragma n') = n /= n'
71separatedDecls (FunctionBody n) (SpecializePragma n') = n /= n'
72separatedDecls (SpecializePragma n) (TypeSignature n') = n /= n'
72separatedDecls (SpecializePragma n) (TypeSignature n') = n /= n'
73+separatedDecls (SpecializePragma n) (SpecializePragma n') = n /= n'
73separatedDecls _ _ = True
74separatedDecls _ _ = True
74
75
75pattern TypeSignature
76pattern TypeSignature