1{-# LANGUAGE MagicHash #-}
2{-# LANGUAGE OverloadedStrings #-}
6import qualified Data.Text as T
7import Data.Attoparsec.Text
9import Prelude hiding (take, takeWhile)
11isAsciiAlpha1 :: Char -> Bool
12isAsciiAlpha1 c = isAsciiLower c || isAsciiUpper c
14isAsciiAlpha2 :: Char -> Bool
16 tagToEnum# ( ((c `geChar#` 'A'#) `andI#` (c `leChar#` 'Z'#))
17 `orI#` ((c `geChar#` 'a'#) `andI#` (c `leChar#` 'z'#)) )
21 [ bench "Text isAsciiAlpha1"
22 $ whnf (T.length . T.takeWhile isAsciiAlpha1) testString
23 , bench "Text isAsciiAlpha2"
24 $ whnf (T.length . T.takeWhile isAsciiAlpha2) testString
26 , bench "Attoparsec isAsciiAlpha1"
27 $ whnf (parseOnly (T.length <$> takeWhile isAsciiAlpha1)) testString
28 , bench "Attoparsec isAsciiAlpha2"
29 $ whnf (parseOnly (T.length <$> takeWhile isAsciiAlpha2)) testString
33testString = T.replicate 10 "helloworldthisisarelativelylongstring"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list