fcf-containers-0.7.2: Data structures and algorithms for first-class-families
Copyright(c) gspia 2020-
LicenseBSD
Maintainergspia
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fcf.Data.Text.Internal

Description

Fcf.Data.Text.Internal

This is from https://kcsongor.github.io/symbol-parsing-haskell/

Please do also check the symbols library at Hackage.

Synopsis

Documentation

type family Head2 (sym :: Symbol) :: Symbol where ... Source #

Equations

Head2 "" = "" 
Head2 sym = Head1 sym (CmpSymbol sym "\128") 

type family ToList (sym :: Symbol) :: [Symbol] where ... Source #

Equations

ToList sym = ToList1 sym "" 

data ToSymbol2 :: [Symbol] -> Exp Symbol Source #

Instances

Instances details
type Eval (ToSymbol2 lst :: Symbol -> Type) Source # 
Instance details

Defined in Fcf.Data.Text.Internal

type Eval (ToSymbol2 lst :: Symbol -> Type) = Eval (Foldr Append "" lst)

data HeadA :: Symbol -> Exp Symbol Source #

Instances

Instances details
type Eval (HeadA sym :: Symbol -> Type) Source # 
Instance details

Defined in Fcf.Data.Text.Internal

type Eval (HeadA sym :: Symbol -> Type) = Head1 sym (CmpSymbol sym "\128")

data ToListA :: Symbol -> Exp [Symbol] Source #

Instances

Instances details
type Eval (ToListA sym :: [Symbol] -> Type) Source # 
Instance details

Defined in Fcf.Data.Text.Internal

type Eval (ToListA sym :: [Symbol] -> Type) = ToList1 sym ""

data Uncons :: Symbol -> Exp (Maybe Symbol) Source #

Instances

Instances details
type Eval (Uncons sym :: Maybe Symbol -> Type) Source # 
Instance details

Defined in Fcf.Data.Text.Internal

type Eval (Uncons sym :: Maybe Symbol -> Type) = Eval ((Map ToSymbol2 :: Maybe [Symbol] -> Maybe Symbol -> Type) =<< ((Tail :: [Symbol] -> Maybe [Symbol] -> Type) =<< ToListA sym))

type family Head1 (x :: Symbol) (o :: Ordering) :: Symbol where ... Source #

Helper, from symbols-package.

Equations

Head1 x 'GT = TypeError ('Text "Starts with non-ASCII character " :<>: 'ShowType x) 
Head1 x _ = LookupA x "" Chars 

type family ToList1 (x :: Symbol) (pfx :: Symbol) :: [Symbol] where ... Source #

Helper, from symbols-package.

Equations

ToList1 x x = '[] 
ToList1 x pfx = ToList2 x pfx (CmpSymbol x (AppendSymbol pfx "\128")) 

type family ToList2 (x :: Symbol) (pfx :: Symbol) (o :: Ordering) :: [Symbol] where ... Source #

Helper, from symbols-package.

Equations

ToList2 x pfx 'LT = LookupA x pfx Chars ': ToList1 x (AppendSymbol pfx (LookupA x pfx Chars)) 
ToList2 x _ _ = TypeError ('Text "Non-AScII character in " :<>: 'ShowType x) 

type family LookupA (x :: Symbol) (pfx :: Symbol) (xs :: Tree Symbol) :: Symbol where ... Source #

Helper, from symbols-package.

Equations

LookupA "" _ _ = "" 
LookupA _ _ ('Leaf x) = x 
LookupA x "" ('Node l c r) = Lookup2 x "" c (CmpSymbol x c) l r 
LookupA x pfx ('Node l c r) = Lookup2 x pfx c (CmpSymbol x (AppendSymbol pfx c)) l r 

type family Lookup2 (x :: Symbol) (pfx :: Symbol) (c :: Symbol) (o :: Ordering) (l :: Tree Symbol) (r :: Tree Symbol) :: Symbol where ... Source #

Helper, from symbols-package.

Equations

Lookup2 _ _ c 'EQ _ _ = c 
Lookup2 x pfx c 'LT l _ = LookupA x pfx l 
Lookup2 x pfx _ 'GT _ r = LookupA x pfx r 

chars :: Tree String Source #

Helper, from symbols-package. (Generate the character tree.)

type Chars = 'Node ('Node ('Node ('Node ('Node ('Node ('Node ('Leaf "\NUL") "\SOH" ('Leaf "\SOH")) "\STX" ('Node ('Leaf "\STX") "\ETX" ('Leaf "\ETX"))) "\EOT" ('Node ('Node ('Leaf "\EOT") "\ENQ" ('Leaf "\ENQ")) "\ACK" ('Node ('Leaf "\ACK") "\a" ('Leaf "\a")))) "\b" ('Node ('Node ('Node ('Leaf "\b") "\t" ('Leaf "\t")) "\n" ('Node ('Leaf "\n") "\v" ('Leaf "\v"))) "\f" ('Node ('Node ('Leaf "\f") "\r" ('Leaf "\r")) "\SO" ('Node ('Leaf "\SO") "\SI" ('Leaf "\SI"))))) "\DLE" ('Node ('Node ('Node ('Node ('Leaf "\DLE") "\DC1" ('Leaf "\DC1")) "\DC2" ('Node ('Leaf "\DC2") "\DC3" ('Leaf "\DC3"))) "\DC4" ('Node ('Node ('Leaf "\DC4") "\NAK" ('Leaf "\NAK")) "\SYN" ('Node ('Leaf "\SYN") "\ETB" ('Leaf "\ETB")))) "\CAN" ('Node ('Node ('Node ('Leaf "\CAN") "\EM" ('Leaf "\EM")) "\SUB" ('Node ('Leaf "\SUB") "\ESC" ('Leaf "\ESC"))) "\FS" ('Node ('Node ('Leaf "\FS") "\GS" ('Leaf "\GS")) "\RS" ('Node ('Leaf "\RS") "\US" ('Leaf "\US")))))) " " ('Node ('Node ('Node ('Node ('Node ('Leaf " ") "!" ('Leaf "!")) "\"" ('Node ('Leaf "\"") "#" ('Leaf "#"))) "$" ('Node ('Node ('Leaf "$") "%" ('Leaf "%")) "&" ('Node ('Leaf "&") "'" ('Leaf "'")))) "(" ('Node ('Node ('Node ('Leaf "(") ")" ('Leaf ")")) "*" ('Node ('Leaf "*") "+" ('Leaf "+"))) "," ('Node ('Node ('Leaf ",") "-" ('Leaf "-")) "." ('Node ('Leaf ".") "/" ('Leaf "/"))))) "0" ('Node ('Node ('Node ('Node ('Leaf "0") "1" ('Leaf "1")) "2" ('Node ('Leaf "2") "3" ('Leaf "3"))) "4" ('Node ('Node ('Leaf "4") "5" ('Leaf "5")) "6" ('Node ('Leaf "6") "7" ('Leaf "7")))) "8" ('Node ('Node ('Node ('Leaf "8") "9" ('Leaf "9")) ":" ('Node ('Leaf ":") ";" ('Leaf ";"))) "<" ('Node ('Node ('Leaf "<") "=" ('Leaf "=")) ">" ('Node ('Leaf ">") "?" ('Leaf "?"))))))) "@" ('Node ('Node ('Node ('Node ('Node ('Node ('Leaf "@") "A" ('Leaf "A")) "B" ('Node ('Leaf "B") "C" ('Leaf "C"))) "D" ('Node ('Node ('Leaf "D") "E" ('Leaf "E")) "F" ('Node ('Leaf "F") "G" ('Leaf "G")))) "H" ('Node ('Node ('Node ('Leaf "H") "I" ('Leaf "I")) "J" ('Node ('Leaf "J") "K" ('Leaf "K"))) "L" ('Node ('Node ('Leaf "L") "M" ('Leaf "M")) "N" ('Node ('Leaf "N") "O" ('Leaf "O"))))) "P" ('Node ('Node ('Node ('Node ('Leaf "P") "Q" ('Leaf "Q")) "R" ('Node ('Leaf "R") "S" ('Leaf "S"))) "T" ('Node ('Node ('Leaf "T") "U" ('Leaf "U")) "V" ('Node ('Leaf "V") "W" ('Leaf "W")))) "X" ('Node ('Node ('Node ('Leaf "X") "Y" ('Leaf "Y")) "Z" ('Node ('Leaf "Z") "[" ('Leaf "["))) "\\" ('Node ('Node ('Leaf "\\") "]" ('Leaf "]")) "^" ('Node ('Leaf "^") "_" ('Leaf "_")))))) "`" ('Node ('Node ('Node ('Node ('Node ('Leaf "`") "a" ('Leaf "a")) "b" ('Node ('Leaf "b") "c" ('Leaf "c"))) "d" ('Node ('Node ('Leaf "d") "e" ('Leaf "e")) "f" ('Node ('Leaf "f") "g" ('Leaf "g")))) "h" ('Node ('Node ('Node ('Leaf "h") "i" ('Leaf "i")) "j" ('Node ('Leaf "j") "k" ('Leaf "k"))) "l" ('Node ('Node ('Leaf "l") "m" ('Leaf "m")) "n" ('Node ('Leaf "n") "o" ('Leaf "o"))))) "p" ('Node ('Node ('Node ('Node ('Leaf "p") "q" ('Leaf "q")) "r" ('Node ('Leaf "r") "s" ('Leaf "s"))) "t" ('Node ('Node ('Leaf "t") "u" ('Leaf "u")) "v" ('Node ('Leaf "v") "w" ('Leaf "w")))) "x" ('Node ('Node ('Node ('Leaf "x") "y" ('Leaf "y")) "z" ('Node ('Leaf "z") "{" ('Leaf "{"))) "|" ('Node ('Node ('Leaf "|") "}" ('Leaf "}")) "~" ('Node ('Leaf "~") "\DEL" ('Leaf "\DEL"))))))) Source #

Helper, from symbols-package. The character tree that is needed for handling the initial character of a symbol.