Open
Description
There are no separate docs yet. Considering what ought be mentioned, I am editing the README (to become a PR when clean and of our agreement).
Here is a start with some questions,
- should
Static.dynamic
become part of the interface example? - should NDIndex be described as an external export, or is it for special uses?
- how to describe
StaticBool
withTrue
,True()
,False
,False()
? - what is a good intro explaining why and where to use this?
Static
Static
defines a limited set of statically parameterized types and a common interface that is shared between them. Defining a new static type that conforms with this interface only requires defining the following:
Static.static(::T)
- given the non-static typeT
return its static counterpart.Static.dynamic(::Type{S})
- given the static typeS
return the known non-static type.Static.is_static(::Type{S})
- given the static typeS
returnTrue()
(elseFalse()
)Static.known(::Type{S})
- given the static typeS
return the known non-static value.
Fore example, the following would appropriately define the interface for StaticChar
Static.static(x::Char) = StaticChar(x)
Static.dynamic(::Type{StaticChar}) = Char
Static.is_static(::Type{T}) where {T<:StaticChar} = True()
Static.known(::Type{StaticChar{C}}) where {C} = C::Char
Exported Types
- StaticBool, True, False
- StaticInt, StaticFloat64
- StaticSymbol
- NDIndex
Metadata
Metadata
Assignees
Labels
No labels