diff --git a/data/examples/declaration/signature/specialize/specialize-out.hs b/data/examples/declaration/signature/specialize/specialize-out.hs index 46505fd..7381881 100644 --- a/data/examples/declaration/signature/specialize/specialize-out.hs +++ b/data/examples/declaration/signature/specialize/specialize-out.hs @@ -11,5 +11,14 @@ baz :: Num a => a -> a baz = id {-# SPECIALIZE [~2] baz :: Int - -> Int + -> Int #-} + +{-# SPECIALIZE fits13Bits :: Int -> Bool, Integer -> Bool #-} +{-# SPECIALIZE fits13Bits + :: Int + -> Bool + , Integer -> Bool + #-} +fits13Bits :: Integral a => a -> Bool +fits13Bits x = x >= -4096 && x < 4096 diff --git a/data/examples/declaration/signature/specialize/specialize.hs b/data/examples/declaration/signature/specialize/specialize.hs index 87d6ffa..13ace5c 100644 --- a/data/examples/declaration/signature/specialize/specialize.hs +++ b/data/examples/declaration/signature/specialize/specialize.hs @@ -14,3 +14,11 @@ baz = id {-# SPECIALIZE [~2] baz :: Int -> Int #-} + +{-# SPECIALIZE fits13Bits :: Int -> Bool, Integer -> Bool #-} +{-# SPECIALIZE fits13Bits + :: Int + -> Bool + , Integer -> Bool #-} +fits13Bits :: Integral a => a -> Bool +fits13Bits x = x >= -4096 && x < 4096 diff --git a/src/Ormolu/Printer/Meat/Declaration/Signature.hs b/src/Ormolu/Printer/Meat/Declaration/Signature.hs index 4e45051..28208a7 100644 --- a/src/Ormolu/Printer/Meat/Declaration/Signature.hs +++ b/src/Ormolu/Printer/Meat/Declaration/Signature.hs @@ -125,10 +125,7 @@ p_specSig name ts InlinePragma {..} = pragmaBraces $ do breakpoint inci $ do txt ":: " - -- XXX Not at all sure why ts is a list of @LHsSigType GhcPs@ things, it - -- appears that we only can give one type to specialize to per pragma. - -- Maybe I'm mistaken. - located (hsib_body (head ts)) p_hsType + velt (withSep comma (located' p_hsType) (hsib_body <$> ts)) p_activation :: Activation -> R () p_activation = \case