Skip to content

Commit

Permalink
Make the Tiny benchmark build again.
Browse files Browse the repository at this point in the history
  • Loading branch information
bos committed Dec 13, 2011
1 parent d96b48c commit 0ab55df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 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
Expand All @@ -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
Expand Down

0 comments on commit 0ab55df

Please sign in to comment.