1{-# LANGUAGE ExistentialQuantification #-}
4import qualified Data.Text.Utf8.Fusion as U8
5import qualified Data.Text.Utf8.Internal as U8I
6import qualified Data.Text.Utf32.Fusion as U32
7import qualified Data.Text.Utf32.Internal as U32I
8import qualified Data.Text.Fusion as S
9import Data.Text.Fusion (bsStream,Encoding(..))
10import qualified Data.Text as T
11import qualified Data.ByteString as B
15instance Forceable U32I.Text
16instance Forceable U8I.Text
18data E a = forall b. E (a -> b) | EText (a -> S.Stream Char)
20main = do force (ascii_tests, smp_sip_tests)
21 ascii <- B.readFile "ascii.txt"
22 let ascii8 = U8.unstream (bsStream ascii ASCII)
23 let ascii16 = S.unstream (bsStream ascii ASCII)
24 let ascii32 = U32.unstream (bsStream ascii ASCII)
25 force (ascii8, ascii16, ascii32)
26 printf " # Utf8\t\tUtf16\tUtf32\n"
27 run 1 (ascii8, ascii16, ascii32) ascii_tests
29 bmp <- B.readFile "bmp.txt"
30 let bmp8 = U8.unstream (bsStream bmp Utf8)
31 let bmp16 = S.unstream (bsStream bmp Utf8)
32 let bmp32 = U32.unstream (bsStream bmp Utf8)
33 force (bmp8, bmp16, bmp32)
34 printf " # Utf8\t\tUtf16\tUtf32\n"
35 run 1 (bmp8, bmp16, bmp32) ascii_tests
37 smp_sip <- B.readFile "smp_sip.txt"
38 let smp_sip8 = U8.unstream (bsStream smp_sip Utf8)
39 let smp_sip16 = S.unstream (bsStream smp_sip Utf8)
40 let smp_sip32 = U32.unstream (bsStream smp_sip Utf8)
41 force (smp_sip8, smp_sip16, smp_sip32)
42 printf " # Utf8\t\tUtf16\tUtf32\n"
43 run 1 (smp_sip8, smp_sip16, smp_sip32) smp_sip_tests
47 [F $ app1 $ U8.unstream . S.cons '\88' . U8.stream,
48 F $ app2 $ S.unstream . S.cons '\88' . S.stream,
49 F $ app3 $ U32.unstream . S.cons '\88' . U32.stream]),
51 [F $ app1 $ S.length . U8.stream,
52 F $ app2 $ S.length . S.stream,
53 F $ app3 $ S.length . U32.stream]),
55 [F $ app1 $ U8.unstream . S.map succ . U8.stream,
56 F $ app2 $ S.unstream . S.map succ . S.stream,
57 F $ app3 $ U32.unstream . S.map succ . U32.stream]),
59 [F $ app1 $ U8.unstream . S.filter (/= '\101') . U8.stream,
60 F $ app2 $ S.unstream . S.filter (/= '\101') . S.stream,
61 F $ app3 $ U32.unstream . S.filter (/= '\101') . U32.stream]),
63 [F $ app1 $ U8.unstream . S.take 1000000 . U8.stream,
64 F $ app2 $ S.unstream . S.take 1000000 . S.stream,
65 F $ app3 $ U32.unstream . S.take 1000000 . U32.stream]),
67 [F $ app1 $ U8.unstream . S.drop 1000000 . U8.stream,
68 F $ app2 $ S.unstream . S.drop 1000000 . S.stream,
69 F $ app3 $ U32.unstream . S.drop 1000000 . U32.stream]),
71 [F $ app1 $ S.foldl' (\a w -> a+1::Int) 0 . U8.stream,
72 F $ app2 $ S.foldl' (\a w -> a+1::Int) 0 . S.stream,
73 F $ app3 $ S.foldl' (\a w -> a+1::Int) 0 . U32.stream
79 [F $ app1 $ U8.unstream . S.cons '\88' . U8.stream,
80 F $ app2 $ S.unstream . S.cons '\88' . S.stream,
81 F $ app3 $ U32.unstream . S.cons '\88' . U32.stream]),
83 [F $ app1 $ S.length . U8.stream,
84 F $ app2 $ S.length . S.stream,
85 F $ app3 $ S.length . U32.stream]),
87 [F $ app1 $ U8.unstream . S.map succ . U8.stream,
88 F $ app2 $ S.unstream . S.map succ . S.stream,
89 F $ app3 $ U32.unstream . S.map succ . U32.stream]),
91 [F $ app1 $ U8.unstream . S.filter (/= '\101') . U8.stream,
92 F $ app2 $ S.unstream . S.filter (/= '\101') . S.stream,
93 F $ app3 $ U32.unstream . S.filter (/= '\101') . U32.stream]),
95 [F $ app1 $ U8.unstream . S.take 1000000 . U8.stream,
96 F $ app2 $ S.unstream . S.take 1000000 . S.stream,
97 F $ app3 $ U32.unstream . S.take 1000000 . U32.stream]),
99 [F $ app1 $ U8.unstream . S.drop 1000000 . U8.stream,
100 F $ app2 $ S.unstream . S.drop 1000000 . S.stream,
101 F $ app3 $ U32.unstream . S.drop 1000000 . U32.stream]),
103 [F $ app1 $ S.foldl' (\a w -> a+1::Int) 0 . U8.stream,
104 F $ app2 $ S.foldl' (\a w -> a+1::Int) 0 . S.stream,
105 F $ app3 $ S.foldl' (\a w -> a+1::Int) 0 . U32.stream])
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