Skip to content
Browse files

Make the Tiny benchmark build again.

  • Loading branch information...
1 parent d96b48c commit 0ab55dfc3c44b94fae036b55cbb3d67f9b0e642a @bos committed Dec 12, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 benchmarks/Tiny.hs
View
8 benchmarks/Tiny.hs
@@ -1,7 +1,7 @@
-import Control.Applicative ((<|>))
+import Control.Applicative ((<|>), many)
import Control.Monad (forM_)
import System.Environment (getArgs)
-import qualified Data.Attoparsec.Char8 as A
+import qualified Data.Attoparsec.ByteString.Char8 as A
import qualified Data.ByteString.Char8 as B
import qualified Text.Parsec as P
import qualified Text.Parsec.ByteString as P
@@ -14,8 +14,8 @@ attoparsec = do
A.Done _ xs -> print (length xs)
what -> print what
where
- slow = A.many (A.many1 A.letter_ascii <|> A.many1 A.digit)
- fast = A.many (A.takeWhile1 isLetter <|> A.takeWhile1 isDigit)
+ slow = many (A.many1 A.letter_ascii <|> A.many1 A.digit)
+ fast = many (A.takeWhile1 isLetter <|> A.takeWhile1 isDigit)
isDigit c = c >= '0' && c <= '9'
isLetter c = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
p = fast

0 comments on commit 0ab55df

Please sign in to comment.
Something went wrong with that request. Please try again.