on master help sign in
use String over [Char]
bed8068Willem Van Onsem
src/Data/Terminfo/Parse.hs+1−1
@@ -99,7 +99,7 @@ parseCapExpression capString =
99 Left e -> Left e
99 Left e -> Left e
100 Right buildResults -> Right $ constructCapExpression capString buildResults
100 Right buildResults -> Right $ constructCapExpression capString buildResults
101
101
102−constructCapExpression :: [Char] -> BuildResults -> CapExpression
102+constructCapExpression :: String -> BuildResults -> CapExpression
103constructCapExpression capString buildResults =
103constructCapExpression capString buildResults =
104 let expr = CapExpression
104 let expr = CapExpression
105 { capOps = outCapOps buildResults
105 { capOps = outCapOps buildResults
src/Graphics/Vty/Input/Classify.hs+3−3
@@ -24,7 +24,7 @@ import qualified Data.Set as S( fromList, member )
24import Data.Char
24import Data.Char
25import Data.Word
25import Data.Word
26
26
27−compile :: ClassifyMap -> [Char] -> KClass
27+compile :: ClassifyMap -> String -> KClass
28compile table = cl' where
28compile table = cl' where
29 -- take all prefixes and create a set of these
29 -- take all prefixes and create a set of these
30 prefixSet = S.fromList $ concatMap (init . inits . fst) $ table
30 prefixSet = S.fromList $ concatMap (init . inits . fst) $ table
@@ -51,7 +51,7 @@ compile table = cl' where
51 -- neither a prefix or a full event.
51 -- neither a prefix or a full event.
52 [] -> Invalid
52 [] -> Invalid
53
53
54−classify :: ClassifyMap -> [Char] -> KClass
54+classify :: ClassifyMap -> String -> KClass
55classify table =
55classify table =
56 let standardClassifier = compile table
56 let standardClassifier = compile table
57 in \s -> case s of
57 in \s -> case s of
@@ -64,7 +64,7 @@ classify table =
64 c:cs | ord c >= 0xC2 -> classifyUtf8 c cs
64 c:cs | ord c >= 0xC2 -> classifyUtf8 c cs
65 _ -> standardClassifier s
65 _ -> standardClassifier s
66
66
67−classifyUtf8 :: Char -> [Char] -> KClass
67+classifyUtf8 :: Char -> String -> KClass
68classifyUtf8 c cs =
68classifyUtf8 c cs =
69 let n = utf8Length (ord c)
69 let n = utf8Length (ord c)
70 (codepoint,rest) = splitAt n (c:cs)
70 (codepoint,rest) = splitAt n (c:cs)
src/Graphics/Vty/Input/Classify/Types.hs+1−1
@@ -8,7 +8,7 @@ where
8import Graphics.Vty.Input.Events
8import Graphics.Vty.Input.Events
9
9
10data KClass
10data KClass
11− = Valid Event [Char]
11+ = Valid Event String
12 -- ^ A valid event was parsed. Any unused characters from the input
12 -- ^ A valid event was parsed. Any unused characters from the input
13 -- stream are also provided.
13 -- stream are also provided.
14 | Invalid
14 | Invalid