mirror of
https://github.com/google/ormolu.git
synced 2024-12-03 18:52:19 +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
|
baz = id
|
||||||
{-# SPECIALIZE [~2] baz
|
{-# SPECIALIZE [~2] baz
|
||||||
:: Int
|
:: 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
|
{-# SPECIALIZE [~2] baz
|
||||||
:: Int
|
:: 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
|
||||||
|
@ -125,10 +125,7 @@ p_specSig name ts InlinePragma {..} = pragmaBraces $ do
|
|||||||
breakpoint
|
breakpoint
|
||||||
inci $ do
|
inci $ do
|
||||||
txt ":: "
|
txt ":: "
|
||||||
-- XXX Not at all sure why ts is a list of @LHsSigType GhcPs@ things, it
|
velt (withSep comma (located' p_hsType) (hsib_body <$> ts))
|
||||||
-- appears that we only can give one type to specialize to per pragma.
|
|
||||||
-- Maybe I'm mistaken.
|
|
||||||
located (hsib_body (head ts)) p_hsType
|
|
||||||
|
|
||||||
p_activation :: Activation -> R ()
|
p_activation :: Activation -> R ()
|
||||||
p_activation = \case
|
p_activation = \case
|
||||||
|
Loading…
Reference in New Issue
Block a user