Commits

wren romano committed 15c8b93

added explicit definitions for (<*) and (*>)

Comments (0)

Files changed (1)

Data/Attoparsec/Internal.hs

 {-# INLINE apP #-}
 
 instance Applicative Parser where
-    pure  = returnP
-    (<*>) = apP
+    pure   = returnP
+    (<*>)  = apP
+    
+    -- These definitions are equal to the defaults, but this
+    -- way the optimizer doesn't have to work so hard to figure
+    -- that out.
+    (*>)   = (>>)
+    x <* y = x >>= \a -> y >> return a
 
 instance Alternative Parser where
     empty = failDesc "empty"