mirror of
https://github.com/google/ormolu.git
synced 2024-12-02 23:43:34 +03:00
Comma-separated SPECIALIZE types
This commit is contained in:
parent
984e4b674f
commit
fd4fa7f33e
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user