1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 04:10:29 +03:00

Move the INLINEs for inj'/prj' next to them.

This commit is contained in:
Rob Rix 2018-05-02 11:46:45 -04:00
parent b31333f637
commit 3313e12047

View File

@ -72,14 +72,14 @@ infixr 5 :<
data Sum (r :: [ * -> * ]) (v :: *) where
Sum :: {-# UNPACK #-} !Int -> t v -> Sum r v
{-# INLINE prj' #-}
{-# INLINE inj' #-}
inj' :: Int -> t v -> Sum r v
inj' = Sum
{-# INLINE inj' #-}
prj' :: Int -> Sum r v -> Maybe (t v)
prj' n (Sum n' x) | n == n' = Just (unsafeCoerce x)
| otherwise = Nothing
| otherwise = Nothing
{-# INLINE prj' #-}
newtype P (t :: * -> *) (r :: [* -> *]) = P { unP :: Int }