on master help sign in
use String over [Char]
commitbed8068d37a18465492df12342430edfd7c141fd authorWillem Van Onsem <vanonsem.willem@gmail.com> dateMon 15 Feb 2021, 17:42 (6 years ago) parent90ea183
3 files changed+5−5
src/Data/Terminfo/Parse.hs+1−1 src/Graphics/Vty/Input/Classify.hs+3−3 src/Graphics/Vty/Input/Classify/Types.hs+1−1
src/Data/Terminfo/Parse.hs+1−1
@@ -99,7 +99,7 @@ parseCapExpression capString =
9999 Left e -> Left e
100100 Right buildResults -> Right $ constructCapExpression capString buildResults
101101
102−constructCapExpression :: [Char] -> BuildResults -> CapExpression
102+constructCapExpression :: String -> BuildResults -> CapExpression
103103constructCapExpression capString buildResults =
104104 let expr = CapExpression
105105 { capOps = outCapOps buildResults
src/Graphics/Vty/Input/Classify.hs+3−3
@@ -24,7 +24,7 @@ import qualified Data.Set as S( fromList, member )
2424import Data.Char
2525import Data.Word
2626
27−compile :: ClassifyMap -> [Char] -> KClass
27+compile :: ClassifyMap -> String -> KClass
2828compile table = cl' where
2929 -- take all prefixes and create a set of these
3030 prefixSet = S.fromList $ concatMap (init . inits . fst) $ table
@@ -51,7 +51,7 @@ compile table = cl' where
5151 -- neither a prefix or a full event.
5252 [] -> Invalid
5353
54−classify :: ClassifyMap -> [Char] -> KClass
54+classify :: ClassifyMap -> String -> KClass
5555classify table =
5656 let standardClassifier = compile table
5757 in \s -> case s of
@@ -64,7 +64,7 @@ classify table =
6464 c:cs | ord c >= 0xC2 -> classifyUtf8 c cs
6565 _ -> standardClassifier s
6666
67−classifyUtf8 :: Char -> [Char] -> KClass
67+classifyUtf8 :: Char -> String -> KClass
6868classifyUtf8 c cs =
6969 let n = utf8Length (ord c)
7070 (codepoint,rest) = splitAt n (c:cs)
src/Graphics/Vty/Input/Classify/Types.hs+1−1
@@ -8,7 +8,7 @@ where
88import Graphics.Vty.Input.Events
99
1010data KClass
11− = Valid Event [Char]
11+ = Valid Event String
1212 -- ^ A valid event was parsed. Any unused characters from the input
1313 -- stream are also provided.
1414 | Invalid