Skip to content

Static types useful for dispatch and generated functions.

License

Notifications You must be signed in to change notification settings

simeonschaub/Static.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static

Stable Dev Build Status Coverage

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 type T return its static counterpart.
  • Static.is_static(::Type{S}) - given the static type S return True().
  • Static.known(::Type{S})- given the static type S return the known non-static value.

Fore example, the following would appropriately define the interface for StaticChar

Static.static(x::Char) = StaticChar(x)
Static.is_static(::Type{T}) where {T<:StaticChar} = True()
Static.known(::Type{StaticChar{C}}) where {C} = C::Char

About

Static types useful for dispatch and generated functions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%