Copyright | (c) gspia 2020- |
---|---|
License | BSD |
Maintainer | gspia |
Safe Haskell | Safe |
Language | Haskell2010 |
Fcf.Data.Symbol
Type-level symbols and functions for them.
Note that the operators from this module conflict with GHC.TypeLits.
Synopsis
- data Symbol
- data Append :: Symbol -> Symbol -> Exp Symbol
- data Intercalate :: Symbol -> [Symbol] -> Exp Symbol
- data (<=) :: Symbol -> Symbol -> Exp Bool
- data (>=) :: Symbol -> Symbol -> Exp Bool
- data (<) :: Symbol -> Symbol -> Exp Bool
- data (>) :: Symbol -> Symbol -> Exp Bool
- data (==) :: Symbol -> Symbol -> Exp Bool
Reexported type
From GHC.TypeList.
(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 |
KnownSymbol a => SingI (a :: Symbol) | Since: base-4.9.0.0 |
Defined in GHC.Generics sing :: Sing a | |
data Sing (s :: Symbol) | |
Defined in GHC.Generics | |
type DemoteRep Symbol | |
Defined in GHC.Generics | |
type Eval (Intercalate s1 ([] :: [Symbol]) :: Symbol -> Type) Source # | |
Defined in Fcf.Data.Symbol | |
type Eval (Intercalate s1 (s ': sLst) :: Symbol -> Type) Source # | |
Defined in Fcf.Data.Symbol | |
type Eval (Append s1 s2 :: Symbol -> Type) Source # | |
Defined in Fcf.Data.Symbol |
Functions
data Append :: Symbol -> Symbol -> Exp Symbol Source #
Append two type-level symbols.
Example
>>>
:kind! Eval (Append "hmm" " ok")
Eval (Append "hmm" " ok") :: Symbol = "hmm ok"
data Intercalate :: Symbol -> [Symbol] -> Exp Symbol Source #
Intercalate type-level symbols.
Example
>>>
: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 # | |
Defined in Fcf.Data.Symbol | |
type Eval (Intercalate s1 (s ': sLst) :: Symbol -> Type) Source # | |
Defined in Fcf.Data.Symbol |
Comparison functions
data (<=) :: Symbol -> Symbol -> Exp Bool Source #
Less-than-or-equal comparison for symbols.
Example
>>>
:kind! Eval ("b" <= "a")
Eval ("b" <= "a") :: Bool = 'False
data (>=) :: Symbol -> Symbol -> Exp Bool Source #
Larger-than-or-equal comparison for symbols.
Example
>>>
:kind! Eval ("b" >= "a")
Eval ("b" >= "a") :: Bool = 'True
data (<) :: Symbol -> Symbol -> Exp Bool Source #
Less-than comparison for symbols.
Example
>>>
:kind! Eval ("a" < "b")
Eval ("a" < "b") :: Bool = 'True