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

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

Fcf.Data.Symbol

Contents

Description

Fcf.Data.Symbol

Type-level symbols and functions for them.

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

Synopsis

Reexported type

data Symbol #

(Kind) This is the kind of type-level symbols. Declared here because class IP needs it

Instances
SingKind Symbol

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type DemoteRep Symbol :: Type

Methods

fromSing :: Sing a -> DemoteRep Symbol

KnownSymbol a => SingI (a :: Symbol)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing a

data Sing (s :: Symbol) 
Instance details

Defined in GHC.Generics

data Sing (s :: Symbol) where
type DemoteRep Symbol 
Instance details

Defined in GHC.Generics

type DemoteRep Symbol = String
type Eval (Intercalate s1 ([] :: [Symbol]) :: Symbol -> Type) Source # 
Instance details

Defined in Fcf.Data.Symbol

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

Defined in Fcf.Data.Symbol

type Eval (Intercalate s1 (s ': sLst) :: Symbol -> Type)
type Eval (Append s1 s2 :: Symbol -> Type) Source # 
Instance details

Defined in Fcf.Data.Symbol

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

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.Data.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.Data.Symbol

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

Defined in Fcf.Data.Symbol

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

Comparison functions

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.Data.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.Data.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.Data.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.Data.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.Data.Symbol

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