fcf-containers-0.5.0: Data structures and algorithms for first-class-families

Copyright(c) gspia 2020-
LicenseBSD
Maintainergspia
Safe HaskellSafe
LanguageHaskell2010

Fcf.Alg.Symbol

Contents

Description

Fcf.Alg.Symbol

Type-level symbols and functions for them.

Note that the operators from this module conflict with GHC.TypeLits.

TODO: Would this whole module have a place first-class-families?

Synopsis

Reexported type

From Fcf.Data.Symbol (which is from GHC).

Functions

data Append :: Symbol -> Symbol -> Exp Symbol Source #

Append two type-level symbols.

Example

Expand
>>> :kind! Eval (Append "hmm" " ok")
Eval (Append "hmm" " ok") :: Symbol
= "hmm ok"
Instances
type Eval (Append s1 s2 :: Symbol -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (Append s1 s2 :: Symbol -> Type) = AppendSymbol s1 s2

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

Intercalate type-level symbols.

Example

Expand
>>> :kind! Eval (Intercalate "+" '["aa", "bb", "cc"])
Eval (Intercalate "+" '["aa", "bb", "cc"]) :: Symbol
= "aa+bb+cc"
>>> :kind! Eval (Intercalate "+" '["aa"])
Eval (Intercalate "+" '["aa"]) :: Symbol
= "aa"
>>> :kind! Eval (Intercalate "+" '[])
Eval (Intercalate "+" '[]) :: Symbol
= ""
Instances
type Eval (Intercalate s1 ([] :: [Symbol]) :: Symbol -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (Intercalate s1 ([] :: [Symbol]) :: Symbol -> Type) = ""
type Eval (Intercalate s1 (s ': sLst) :: Symbol -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (Intercalate s1 (s ': sLst) :: Symbol -> Type)

data IsSpace :: Symbol -> Exp Bool Source #

IsSpace

Example

Expand
>>> :kind! Eval (IsSpace "a")
Eval (IsSpace "a") :: Bool
= 'False
>>> :kind! Eval (IsSpace " ")
Eval (IsSpace " ") :: Bool
= 'True
Instances
type Eval (IsSpace s :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (IsSpace s :: Bool -> Type) = Eval (s == " ")

data IsNewLine :: Symbol -> Exp Bool Source #

IsNewline

Example

Expand
>>> :kind! Eval (IsNewLine "a")
Eval (IsNewLine "a") :: Bool
= 'False
>>> :kind! Eval (IsNewLine "\n")
Eval (IsNewLine "\n") :: Bool
= 'True
Instances
type Eval (IsNewLine s :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (IsNewLine s :: Bool -> Type) = Eval (s == "\n")

data IsTab :: Symbol -> Exp Bool Source #

IsTab

Example

Expand
>>> :kind! Eval (IsTab "a")
Eval (IsTab "a") :: Bool
= 'False
>>> :kind! Eval (IsTab "\t")
Eval (IsTab "\t") :: Bool
= 'True
Instances
type Eval (IsTab s :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (IsTab s :: Bool -> Type) = Eval (s == "\t")

data IsSpaceDelim :: Symbol -> Exp Bool Source #

IsSpaceDelim

Example

Expand
>>> :kind! Eval (IsSpaceDelim "a")
Eval (IsSpaceDelim "a") :: Bool
= 'False
>>> :kind! Eval (IsSpaceDelim "\n")
Eval (IsSpaceDelim "\n") :: Bool
= 'True
Instances
type Eval (IsSpaceDelim s :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (IsSpaceDelim s :: Bool -> Type) = Eval (Eval (IsSpace s) || Eval (Eval (IsNewLine s) || Eval (IsTab s)))

data IsDigit :: Symbol -> Exp Bool Source #

IsDigit

Example

Expand
>>> :kind! Eval (IsDigit "3")
Eval (IsDigit "3") :: Bool
= 'True
>>> :kind! Eval (IsDigit "a")
Eval (IsDigit "a") :: Bool
= 'False
Instances
type Eval (IsDigit s :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (IsDigit s :: Bool -> Type) = Eval (Elem s ("0" ': ("1" ': ("2" ': ("3" ': ("4" ': ("5" ': ("6" ': ("7" ': ("8" ': ("9" ': ([] :: [Symbol]))))))))))))

Comparison functions

data SymbolOrd :: Symbol -> Symbol -> Exp Ordering Source #

SymbolOrd - compare two symbols and give type-level Ordering ( $ 'LT $, $ 'EQ $ or $ 'GT $ ).

Example

Expand
>>> :kind! Eval (SymbolOrd "a" "b")
Eval (SymbolOrd "a" "b") :: Ordering
= 'LT
Instances
type Eval (SymbolOrd a b :: Ordering -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (SymbolOrd a b :: Ordering -> Type) = CmpSymbol a b

data (<=) :: Symbol -> Symbol -> Exp Bool Source #

Less-than-or-equal comparison for symbols.

Example

Expand
>>> :kind! Eval ("b" <= "a")
Eval ("b" <= "a") :: Bool
= 'False
Instances
type Eval (a <= b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (a <= b :: Bool -> Type) = Eval (Eval (TyEq (CmpSymbol a b) LT) || Eval (TyEq (CmpSymbol a b) EQ))

data (>=) :: Symbol -> Symbol -> Exp Bool Source #

Larger-than-or-equal comparison for symbols.

Example

Expand
>>> :kind! Eval ("b" >= "a")
Eval ("b" >= "a") :: Bool
= 'True
Instances
type Eval (a >= b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (a >= b :: Bool -> Type) = Eval (Eval (TyEq (CmpSymbol a b) GT) || Eval (TyEq (CmpSymbol a b) EQ))

data (<) :: Symbol -> Symbol -> Exp Bool Source #

Less-than comparison for symbols.

Example

Expand
>>> :kind! Eval ("a" < "b")
Eval ("a" < "b") :: Bool
= 'True
Instances
type Eval (a < b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (a < b :: Bool -> Type) = Eval (TyEq (CmpSymbol a b) LT)

data (>) :: Symbol -> Symbol -> Exp Bool Source #

Larger-than comparison for symbols.

Example

Expand
>>> :kind! Eval ("b" > "a")
Eval ("b" > "a") :: Bool
= 'True
Instances
type Eval (a > b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (a > b :: Bool -> Type) = Eval (TyEq (CmpSymbol a b) GT)

data (==) :: Symbol -> Symbol -> Exp Bool Source #

Equality of symbols

Example

Expand
>>> :kind! Eval ("b" == "a")
Eval ("b" == "a") :: Bool
= 'False
Instances
type Eval (a == b :: Bool -> Type) Source # 
Instance details

Defined in Fcf.Alg.Symbol

type Eval (a == b :: Bool -> Type) = Eval (TyEq (CmpSymbol a b) EQ)