1
1
mirror of https://github.com/coot/free-category.git synced 2024-10-26 15:15:00 +03:00

Remove some redundant INLINE pragmas

This commit is contained in:
Marcin Szamotulski 2019-09-08 15:23:19 +02:00
parent a7dfb4473a
commit 53616ddd34
2 changed files with 3 additions and 7 deletions

View File

@ -144,9 +144,8 @@ compose f Id = f
{-# INLINE [1] compose #-}
instance Category (Cat f) where
id = Id
id = Id
(.) = compose
{-# INLINE (.) #-}
instance Semigroup (Cat f a a) where
f <> g = f `compose` g
@ -280,7 +279,7 @@ op :: forall (f :: k -> k -> *) x y.
Cat f x y
-> Cat (Op f) y x
op = unsafeCoerce
{-# INLINE [2] op #-}
{-# INLINE [1] op #-}
-- | Since `op` is an identity, it inverse `unOp` must be too. Thus we can
-- also use `unsafeCoerce`.
@ -291,7 +290,7 @@ unOp :: forall (f :: k -> k -> *) x y.
unOp = unsafeCoerce
-- unOp Id = Id
-- unOp (Cat q (Op tr)) = Cat nilQ tr . foldNatQ unDual q
{-# INLINE [2] unOp #-}
{-# INLINE [1] unOp #-}
{-# RULES
@ -377,7 +376,6 @@ composeC (C g) (C f) = C $ \k -> g k . f k
instance Category (C f) where
id = C (const id)
(.) = composeC
{-# INLINE (.) #-}
#if __GLASGOW_HASKELL__ >= 806
-- | Show instance via 'ListTr'

View File

@ -135,14 +135,12 @@ instance Category (ListTr f) where
id = NilTr
(ConsTr x xs) . ys = ConsTr x (xs . ys)
NilTr . ys = ys
{-# INLINE (.) #-}
type instance AlgebraType0 ListTr f = ()
type instance AlgebraType ListTr c = Category c
instance FreeAlgebra2 ListTr where
liftFree2 = \fab -> ConsTr fab NilTr
{-# INLINE liftFree2 #-}
foldNatFree2 _ NilTr = id
foldNatFree2 fun (ConsTr bc ab) = fun bc . foldNatFree2 fun ab