Commits

Bryan O'Sullivan committed 4fc1547

Performance improvements?

  • Participants
  • Parent commits f5c4d77

Comments (0)

Files changed (1)

File Data/Attoparsec/Internal.hs

 plus :: Parser a -> Parser a -> Parser a
 plus a b = Parser $ \st0 kf ks ->
            let kf' st1 _ _ = runParser b (mappend st0 st1) kf ks
-           in  runParser a (noAdds st0) kf' ks
+               !st2 = noAdds st0
+           in  runParser a st2 kf' ks
 {-# INLINE plus #-}
 
 instance MonadPlus Parser where
 
 instance Alternative Parser where
     empty = failDesc "empty"
-    (<|>) = mplus
+    (<|>) = plus
 
 failDesc :: String -> Parser a
 failDesc err = Parser (\st0 kf _ks -> kf st0 [] msg)
   if p w
     then put (B.unsafeTail s) >> return w
     else fail "satisfy"
-{-# INLINE satisfy #-}
 
 -- | Character parser.
 satisfyWith :: (Word8 -> a) -> (a -> Bool) -> Parser a
   if p c
     then put (B.unsafeTail s) >> return c
     else fail "satisfyWith"
-{-# INLINE satisfyWith #-}
 
 storable :: Storable a => Parser a
 storable = hack undefined