Skip to content

Function to find the Differential type for a given primal type #106

Open
@oxinabox

Description

@oxinabox

When declaring rules for constructors of parameteric types (e.g. Arrays)
one needs too know what the parameter type of the elements are.

We should define a helper for this.

Its probaly something like:

differential_type(::Type{<:Any})) = Any
differential_type(T::Type{<:Real}) = Union(AbstractZero, T)
differential_type(::Array{T}) where T = Array{differential_type(T)}

This is primarily for use for type parameters of zero arg constructors.
Rather than the general way to do it

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions