Skip to content

Commit 6cb9d87

Browse files
committed
Add INLINE pragmas for funAppMon methods of ParsecParser
1 parent 0efb2ea commit 6cb9d87

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Cabal/Distribution/Parsec/Class.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,35 @@ liftParsec p = PP $ \_ -> p
7878

7979
instance Functor ParsecParser where
8080
fmap f p = PP $ \v -> fmap f (unPP p v)
81+
{-# INLINE fmap #-}
82+
83+
x <$ p = PP $ \v -> x <$ unPP p v
84+
{-# INLINE (<$) #-}
8185

8286
instance Applicative ParsecParser where
8387
pure = liftParsec . pure
88+
{-# INLINE pure #-}
8489

8590
f <*> x = PP $ \v -> unPP f v <*> unPP x v
91+
{-# INLINE (<*>) #-}
8692
f *> x = PP $ \v -> unPP f v *> unPP x v
93+
{-# INLINE (*>) #-}
8794
f <* x = PP $ \v -> unPP f v <* unPP x v
95+
{-# INLINE (<*) #-}
8896

8997
instance Alternative ParsecParser where
9098
empty = liftParsec empty
9199

92100
a <|> b = PP $ \v -> unPP a v <|> unPP b v
101+
{-# INLINE (<|>) #-}
93102

94103
instance Monad ParsecParser where
95104
return = pure
96105

97106
m >>= k = PP $ \v -> unPP m v >>= \x -> unPP (k x) v
107+
{-# INLINE (>>=) #-}
98108
(>>) = (*>)
109+
{-# INLINE (>>) #-}
99110

100111
fail = Fail.fail
101112

0 commit comments

Comments
 (0)