mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
Merge pull request #205 from hapytex/hlint/use-string
use String over [Char]
This commit is contained in:
commit
7f8d21b8d6
@ -99,7 +99,7 @@ parseCapExpression capString =
|
||||
Left e -> Left e
|
||||
Right buildResults -> Right $ constructCapExpression capString buildResults
|
||||
|
||||
constructCapExpression :: [Char] -> BuildResults -> CapExpression
|
||||
constructCapExpression :: String -> BuildResults -> CapExpression
|
||||
constructCapExpression capString buildResults =
|
||||
let expr = CapExpression
|
||||
{ capOps = outCapOps buildResults
|
||||
|
@ -24,7 +24,7 @@ import qualified Data.Set as S( fromList, member )
|
||||
import Data.Char
|
||||
import Data.Word
|
||||
|
||||
compile :: ClassifyMap -> [Char] -> KClass
|
||||
compile :: ClassifyMap -> String -> KClass
|
||||
compile table = cl' where
|
||||
-- take all prefixes and create a set of these
|
||||
prefixSet = S.fromList $ concatMap (init . inits . fst) $ table
|
||||
@ -51,7 +51,7 @@ compile table = cl' where
|
||||
-- neither a prefix or a full event.
|
||||
[] -> Invalid
|
||||
|
||||
classify :: ClassifyMap -> [Char] -> KClass
|
||||
classify :: ClassifyMap -> String -> KClass
|
||||
classify table =
|
||||
let standardClassifier = compile table
|
||||
in \s -> case s of
|
||||
@ -64,7 +64,7 @@ classify table =
|
||||
c:cs | ord c >= 0xC2 -> classifyUtf8 c cs
|
||||
_ -> standardClassifier s
|
||||
|
||||
classifyUtf8 :: Char -> [Char] -> KClass
|
||||
classifyUtf8 :: Char -> String -> KClass
|
||||
classifyUtf8 c cs =
|
||||
let n = utf8Length (ord c)
|
||||
(codepoint,rest) = splitAt n (c:cs)
|
||||
|
@ -8,7 +8,7 @@ where
|
||||
import Graphics.Vty.Input.Events
|
||||
|
||||
data KClass
|
||||
= Valid Event [Char]
|
||||
= Valid Event String
|
||||
-- ^ A valid event was parsed. Any unused characters from the input
|
||||
-- stream are also provided.
|
||||
| Invalid
|
||||
|
Loading…
Reference in New Issue
Block a user