Skip to content

Commit fc0f160

Browse files
committed
Add INLINE pragmas for funAppMon methods of ParsecParser
1 parent 55794fe commit fc0f160

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
@@ -80,24 +80,35 @@ liftParsec p = PP $ \_ -> p
8080

8181
instance Functor ParsecParser where
8282
fmap f p = PP $ \v -> fmap f (unPP p v)
83+
{-# INLINE fmap #-}
84+
85+
x <$ p = PP $ \v -> x <$ unPP p v
86+
{-# INLINE (<$) #-}
8387

8488
instance Applicative ParsecParser where
8589
pure = liftParsec . pure
90+
{-# INLINE pure #-}
8691

8792
f <*> x = PP $ \v -> unPP f v <*> unPP x v
93+
{-# INLINE (<*>) #-}
8894
f *> x = PP $ \v -> unPP f v *> unPP x v
95+
{-# INLINE (*>) #-}
8996
f <* x = PP $ \v -> unPP f v <* unPP x v
97+
{-# INLINE (<*) #-}
9098

9199
instance Alternative ParsecParser where
92100
empty = liftParsec empty
93101

94102
a <|> b = PP $ \v -> unPP a v <|> unPP b v
103+
{-# INLINE (<|>) #-}
95104

96105
instance Monad ParsecParser where
97106
return = pure
98107

99108
m >>= k = PP $ \v -> unPP m v >>= \x -> unPP (k x) v
109+
{-# INLINE (>>=) #-}
100110
(>>) = (*>)
111+
{-# INLINE (>>) #-}
101112

102113
fail = Fail.fail
103114

0 commit comments

Comments
 (0)