Symbol package:ghc-internal
(Kind) This is the kind of type-level symbols.
Haskell symbol, e.g. >>, :%
Concatenation of type-level symbols.
Comparison of type-level symbols, as a function.
Extending a type-level symbol with a type-level character
This class gives the string associated with a type-level symbol. There
are instances of the class for every concrete literal: "hello", etc.
A value-level witness for a type-level symbol. This is commonly
referred to as a
singleton type, as for each
s, there
is a single value that inhabits the type
SSymbol s
(aside from bottom).
The definition of
SSymbol is intentionally left abstract. To
obtain an
SSymbol value, use one of the following:
- The symbolSing method of KnownSymbol.
- The SSymbol pattern synonym.
- The withSomeSSymbol function, which creates an
SSymbol from a String.
A explicitly bidirectional pattern synonym relating an
SSymbol
to a
KnownSymbol constraint.
As an
expression: Constructs an explicit
SSymbol
s value from an implicit
KnownSymbol s
constraint:
SSymbol @s :: KnownSymbol s => SSymbol s
As a
pattern: Matches on an explicit
SSymbol s
value bringing an implicit
KnownSymbol s constraint
into scope:
f :: SSymbol s -> ..
f SSymbol = {- KnownSymbol s in scope -}
This type represents unknown type-level symbols.
This type family yields type-level
Just storing the first
character of a symbol and its tail if it is defined and
Nothing
otherwise.
A pattern that can be used to manipulate the
String that an
SSymbol s contains under the hood.
When using this pattern to construct an
SSymbol s, the actual
String being stored in the
SSymbol must be
equal to (the contents of)
s. The compiler will not help you
verify this, hence the 'unsafe' name.
Like
sameSymbol, but if the symbols aren't equal, this
additionally provides proof of LT or GT.
We either get evidence that this function was instantiated with the
same type-level symbols, or that the type-level symbols are distinct.
Return the String corresponding to
s in an
SSymbol
s value.
We either get evidence that this function was instantiated with the
same type-level symbols, or
Nothing.
Convert a string into an unknown type-level symbol.
Convert a
String into an
SSymbol s value, where
s is a fresh type-level symbol.