Output multiple specialize pragmas in a row nicer

We should not insert newlines between them.
This commit is contained in:
mrkkrp 2019-06-10 21:29:48 +02:00 committed by Mark Karpov
parent e98df37597
commit 656d0369d4
3 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
foo :: Num a => a -> a
foo = id
{-# SPECIALIZE foo :: Int -> Int #-}
{-# SPECIALIZE foo :: Float -> Float #-}
{-# SPECIALIZE [2] bar :: Int -> Int #-}
bar :: Num a => a -> a

View File

@ -2,6 +2,7 @@ foo :: Num a => a -> a
foo = id
{-# SPECIALIZE foo :: Int -> Int #-}
{-# SPECIALIZE foo :: Float -> Float #-}
{-# SPECIALIZE [2] bar :: Int -> Int #-}

View File

@ -70,6 +70,7 @@ separatedDecls (FunctionBody n) (InlinePragma n') = n /= n'
separatedDecls (InlinePragma n) (TypeSignature n') = n /= n'
separatedDecls (FunctionBody n) (SpecializePragma n') = n /= n'
separatedDecls (SpecializePragma n) (TypeSignature n') = n /= n'
separatedDecls (SpecializePragma n) (SpecializePragma n') = n /= n'
separatedDecls _ _ = True
pattern TypeSignature