1-- This script processes the following source file:
3-- http://unicode.org/Public/UNIDATA/CaseFolding.txt
19 } deriving (Eq, Ord, Show)
21entries :: Parser [Fold]
22entries = many comment *> many (entry <* many comment)
24 entry = Fold <$> unichar <* semi
25 <*> oneOf "CFST" <* semi
27 <*> (string "# " *> manyTill anyToken (char '\n'))
29parseCF :: FilePath -> IO (Either ParseError [Fold])
30parseCF name = parse entries name <$> readFile name
32mapCF :: [Fold] -> [String]
33mapCF ms = typ ++ (map nice . filter p $ ms) ++ [last]
35 typ = ["foldMapping :: forall s. Char -> s -> Step (PairS (PairS s Char) Char) Char"
36 ,"{-# INLINE foldMapping #-}"]
37 last = "foldMapping c s = Yield (toLower c) (s :!: '\\0' :!: '\\0')"
38 nice c = "-- " ++ name c ++ "\n" ++
39 "foldMapping " ++ showC (code c) ++ " s = Yield " ++ x ++ " (s :!: " ++ y ++ " :!: " ++ z ++ ")"
40 where [x,y,z] = (map showC . take 3) (mapping c ++ repeat '\0')
41 p f = status f `elem` "CF" &&
42 mapping f /= [toLower (code f)]
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