Character kind
We know and love the Symbol kind, but as far as I know it's not possible to analyse a Symbol type, as we would a String term. It would be nice to have a Character kind and some related type families:
data Character
-- Pattern match a Symbol. 'Nothing when empty, 'Just '(head, tail)
-- otherwise.
type family UnconsSymbol (s :: Symbol) :: Maybe (Character, Symbol)
-- Put a Character at the head of a Symbol.
type family ConsSymbol (c :: Character) (s :: Symbol) :: Symbol
-- Work with Characters. Ideally we'd have counterparts for every
-- function on Data.Char.
type family ToUpper (c :: Character) :: Character
type family IsAlpha (c :: Character) :: Bool
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.3 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |