Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- charExp :: Char -> Q Exp
- charPat :: Char -> Q Pat
- charListExp :: [Char] -> Q Exp
- charListPat :: [Char] -> Q Pat
- caselessListExp :: [CaselessChar] -> Q Exp
- caselessListPat :: [CaselessChar] -> Q Pat
- isCharExp :: Char -> Q Exp
- isCharPat :: Char -> Q Pat
- isStringExp :: [Char] -> Q Exp
- isStringPat :: [Char] -> Q Pat
- caselessIsStringPat :: [CaselessChar] -> Q Pat
Monomorphic
Character
charPat :: Char -> Q Pat Source #
let x = case SmallLetterS of $(charPat SmallLetterR) -> 1 $(charPat SmallLetterS) -> 2 _ -> 3 in x == 2
String
charListExp :: [Char] -> Q Exp Source #
$(charListExp [CapitalLetterH, SmallLetterI]) == [CapitalLetterH, SmallLetterI]
charListPat :: [Char] -> Q Pat Source #
let x = case [CapitalLetterH, SmallLetterI] of $(charListPat [CapitalLetterH, SmallLetterA]) -> 1 $(charListPat [CapitalLetterH, SmallLetterI]) -> 2 _ -> 3 in x == 2
Caseless string
caselessListExp :: [CaselessChar] -> Q Exp Source #
Expression with a FromChar
constraint
$(isCharExp CapitalLetterA) == CapitalLetterA $(isCharExp CapitalLetterA) == (65 :: Word8) $(isCharExp CapitalLetterA) == (asciiUnsafe
65 ::ASCII
Word8)
caselessListPat :: [CaselessChar] -> Q Pat Source #
Polymorphic
Character
isCharPat :: Char -> Q Pat Source #
Pattern that matches a type with a ToChar
constraint
let x = case (66 :: Word8) of $(isCharPat CapitalLetterA) -> 1 $(isCharPat CapitalLetterB) -> 2 _ -> 3 in x == 2
String
isStringExp :: [Char] -> Q Exp Source #
Expression with a FromString
constraint
isStringPat :: [Char] -> Q Pat Source #
Pattern that matches a type with a ToString
constraint
Caseless string
caselessIsStringPat :: [CaselessChar] -> Q Pat Source #
Matches a value of any type belonging to the ToCaselessString
class, as if it were a list of CaselessChar