Merge pull request #205 from hapytex/hlint/use-string

use String over [Char]
This commit is contained in:
Jonathan Daugherty 2021-02-15 14:43:08 -08:00 committed by GitHub
commit 7f8d21b8d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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