Header menu logo Nu

Reflection Module

Provides engine-specific reflection functionality.

Functions and values

Function or value Description

Reflection.attachIntrinsicFacets copyTarget dispatcherMap facetMap source target world

Full Usage: Reflection.attachIntrinsicFacets copyTarget dispatcherMap facetMap source target world

Parameters:
    copyTarget : 'a -> 'a
    dispatcherMap : Map<string, 'd>
    facetMap : Map<string, 'f>
    source : 'b
    target : 'a
    world : obj

Returns: 'a

Attach source's intrinsic facets to a target.

copyTarget : 'a -> 'a
dispatcherMap : Map<string, 'd>
facetMap : Map<string, 'f>
source : 'b
target : 'a
world : obj
Returns: 'a

Reflection.attachIntrinsicFacetsViaNames copyTarget dispatcherMap facetMap facetNames target world

Full Usage: Reflection.attachIntrinsicFacetsViaNames copyTarget dispatcherMap facetMap facetNames target world

Parameters:
    copyTarget : 'a -> 'a
    dispatcherMap : Map<string, 'd>
    facetMap : Map<string, 'f>
    facetNames : string list
    target : 'a
    world : obj

Returns: 'a

Attach intrinsic facets to a target by their names.

copyTarget : 'a -> 'a
dispatcherMap : Map<string, 'd>
facetMap : Map<string, 'f>
facetNames : string list
target : 'a
world : obj
Returns: 'a

Reflection.attachProperties copyTarget source target world

Full Usage: Reflection.attachProperties copyTarget source target world

Parameters:
    copyTarget : 'a -> 'a
    source : 'b
    target : 'a
    world : 'a0

Returns: 'a

Attach source's properties to a target.

copyTarget : 'a -> 'a
source : 'b
target : 'a
world : 'a0
Returns: 'a

Reflection.attachPropertiesViaDefinitions copyTarget definitions target world

Full Usage: Reflection.attachPropertiesViaDefinitions copyTarget definitions target world

Parameters:
Returns: 'a

Attach properties from the given definitions to a target.

copyTarget : 'a -> 'a
definitions : PropertyDefinition list
target : 'a
world : 'a0
Returns: 'a

Reflection.detachProperties copyTarget source target

Full Usage: Reflection.detachProperties copyTarget source target

Parameters:
    copyTarget : 'a -> 'a
    source : 'b
    target : 'a

Returns: 'a

Detach source's properties to a target.

copyTarget : 'a -> 'a
source : 'b
target : 'a
Returns: 'a

Reflection.detachPropertiesViaNames copyTarget propertyNames target

Full Usage: Reflection.detachPropertiesViaNames copyTarget propertyNames target

Parameters:
    copyTarget : 'a -> 'a
    propertyNames : string seq
    target : 'a

Returns: 'a

Detach properties from a target.

copyTarget : 'a -> 'a
propertyNames : string seq
target : 'a
Returns: 'a

Reflection.dispatchesAs dispatcherTargetType dispatcher

Full Usage: Reflection.dispatchesAs dispatcherTargetType dispatcher

Parameters:
    dispatcherTargetType : Type
    dispatcher : 'a

Returns: bool

Check that the dispatcher has behavior congruent to the given type.

dispatcherTargetType : Type
dispatcher : 'a
Returns: bool

Reflection.getBaseTypesExceptObject targetType

Full Usage: Reflection.getBaseTypesExceptObject targetType

Parameters:
Returns: Type list

Get the concrete base types of a type excepting the object type.

targetType : Type
Returns: Type list

Reflection.getIntrinsicFacetNames targetType

Full Usage: Reflection.getIntrinsicFacetNames targetType

Parameters:
Returns: string list

Get the intrinsic facet names of a target type.

targetType : Type
Returns: string list

Reflection.getIntrinsicFacetNamesNoInherit targetType

Full Usage: Reflection.getIntrinsicFacetNamesNoInherit targetType

Parameters:
Returns: string list

Get the intrinsic facet names of a target type not considering inheritance.

targetType : Type
Returns: string list

Reflection.getIntrinsicFacetsNoInherit targetType

Full Usage: Reflection.getIntrinsicFacetsNoInherit targetType

Parameters:
Returns: Type list

Get the intrinsic facet of a target type not considering inheritance.

targetType : Type
Returns: Type list

Reflection.getPropertyDefinitions targetType

Full Usage: Reflection.getPropertyDefinitions targetType

Parameters:
Returns: PropertyDefinition list

Get the property definitions of a target type.

targetType : Type
Returns: PropertyDefinition list

Reflection.getPropertyDefinitionsNoInherit targetType

Full Usage: Reflection.getPropertyDefinitionsNoInherit targetType

Parameters:
Returns: PropertyDefinition list

Get the property definitions of a target type not considering inheritance. OPTIMIZATION: Memoized for efficiency since Properties will likely return a newly constructed list.

targetType : Type
Returns: PropertyDefinition list

Reflection.getPropertyNameCounts definitions

Full Usage: Reflection.getPropertyNameCounts definitions

Parameters:
Returns: Map<string, int>

Get a map of the counts of the property definitions names.

definitions : Map<string, PropertyDefinition list>
Returns: Map<string, int>

Reflection.getPropertyNames targetType

Full Usage: Reflection.getPropertyNames targetType

Parameters:
Returns: string list

Get the names of the property definitions of a target type.

targetType : Type
Returns: string list

Reflection.getReflectivePropertyContainerTypes target

Full Usage: Reflection.getReflectivePropertyContainerTypes target

Parameters:
    target : 'a

Returns: Type list

Get all the reflective container types of a target, including dispatcher and / or facet types.

target : 'a
Returns: Type list

Reflection.getReflectivePropertyContainers target

Full Usage: Reflection.getReflectivePropertyContainers target

Parameters:
    target : 'a

Returns: obj list

Get all the reflective property containers of a target, including dispatcher and / or facets.

target : 'a
Returns: obj list

Reflection.getReflectivePropertyDefinitionMap target

Full Usage: Reflection.getReflectivePropertyDefinitionMap target

Parameters:
    target : 'a

Returns: Map<string, PropertyDefinition list>

Get all the reflective property definitions of a type, including those of its dispatcher and / or facets, organized in a map from the containing type's name to the property definition.

target : 'a
Returns: Map<string, PropertyDefinition list>

Reflection.getReflectivePropertyDefinitions target

Full Usage: Reflection.getReflectivePropertyDefinitions target

Parameters:
    target : 'a

Returns: Map<string, PropertyDefinition>

Get all the unique reflective property definitions of a type, including those of its dispatcher and / or facets.

target : 'a
Returns: Map<string, PropertyDefinition>

Reflection.getSimplifiedTypeNameHack ty

Full Usage: Reflection.getSimplifiedTypeNameHack ty

Parameters:
Returns: string

A hack to retreive a simplified generic type name

ty : Type
Returns: string

Reflection.init ()

Full Usage: Reflection.init ()

Parameters:
    () : unit

Initialize backing data utilized by reflection module.

() : unit

Reflection.isFacetCompatibleWithDispatcher dispatcherMap facet target

Full Usage: Reflection.isFacetCompatibleWithDispatcher dispatcherMap facet target

Parameters:
    dispatcherMap : Map<string, 'd>
    facet : 'f
    target : 'a

Returns: bool

Check for facet compatibility with the target's dispatcher.

dispatcherMap : Map<string, 'd>
facet : 'f
target : 'a
Returns: bool

Reflection.isFacetTypeCompatibleWithDispatcher dispatcherMap facetType target

Full Usage: Reflection.isFacetTypeCompatibleWithDispatcher dispatcherMap facetType target

Parameters:
    dispatcherMap : Map<string, 'a>
    facetType : Type
    target : 'a0

Returns: bool

Check for facet compatibility with the target's dispatcher.

dispatcherMap : Map<string, 'a>
facetType : Type
target : 'a0
Returns: bool

Reflection.isPropertyNonPersistent property target

Full Usage: Reflection.isPropertyNonPersistent property target

Parameters:
Returns: bool

Is the property of the given target not persistent?

property : PropertyInfo
target : 'a
Returns: bool

Reflection.isPropertyNonPersistentByName propertyName

Full Usage: Reflection.isPropertyNonPersistentByName propertyName

Parameters:
    propertyName : string

Returns: bool

Is a property with the given name not persistent?

propertyName : string
Returns: bool

Reflection.loadReferencedAssembliesTransitively assemblyNamePredicate assembly

Full Usage: Reflection.loadReferencedAssembliesTransitively assemblyNamePredicate assembly

Parameters:
Returns: 'a[]

Load all the referenced assemblies of an assembly transitively that satisfy the given predicate.

assemblyNamePredicate : AssemblyName -> bool
assembly : Assembly
Returns: 'a[]

Reflection.memoizable ty

Full Usage: Reflection.memoizable ty

Parameters:
Returns: bool

Determine whether a type is safely memoizable. Thread-safe. TODO: consider moving this into Prime once it's well-tested.

ty : Type
Returns: bool

Reflection.readFacetNamesToTarget copyTarget propertyDescriptors target

Full Usage: Reflection.readFacetNamesToTarget copyTarget propertyDescriptors target

Parameters:
    copyTarget : 'a -> 'a
    propertyDescriptors : Map<string, Symbol>
    target : 'a

Returns: 'a

Read just the target's FacetNames from property descriptors.

copyTarget : 'a -> 'a
propertyDescriptors : Map<string, Symbol>
target : 'a
Returns: 'a

Reflection.readMemberPropertiesToTarget copyTarget propertyDescriptors target

Full Usage: Reflection.readMemberPropertiesToTarget copyTarget propertyDescriptors target

Parameters:
    copyTarget : 'a -> 'a
    propertyDescriptors : Map<string, Symbol>
    target : 'a

Returns: 'a

Read all of a target's member properties from property descriptors (except OverlayNameOpt and FacetNames).

copyTarget : 'a -> 'a
propertyDescriptors : Map<string, Symbol>
target : 'a
Returns: 'a

Reflection.readPropertiesToTarget copyTarget propertyDescriptors target

Full Usage: Reflection.readPropertiesToTarget copyTarget propertyDescriptors target

Parameters:
    copyTarget : 'a -> 'a
    propertyDescriptors : Map<string, Symbol>
    target : 'a

Returns: 'a

Read all of a target's property values from property descriptors (except OverlayNameOpt and FacetNames).

copyTarget : 'a -> 'a
propertyDescriptors : Map<string, Symbol>
target : 'a
Returns: 'a

Reflection.tryReadOverlayNameOptToTarget copyTarget propertyDescriptors target

Full Usage: Reflection.tryReadOverlayNameOptToTarget copyTarget propertyDescriptors target

Parameters:
    copyTarget : 'a -> 'a
    propertyDescriptors : Map<string, Symbol>
    target : 'a

Returns: 'a

Try to read just the target's OverlayNameOpt from property descriptors.

copyTarget : 'a -> 'a
propertyDescriptors : Map<string, Symbol>
target : 'a
Returns: 'a

Reflection.writePropertiesFromTarget shouldWriteProperty propertyDescriptors target

Full Usage: Reflection.writePropertiesFromTarget shouldWriteProperty propertyDescriptors target

Parameters:
    shouldWriteProperty : string -> Type -> obj -> bool
    propertyDescriptors : Map<string, Symbol>
    target : 'a

Returns: Map<string, Symbol>

Write all of a target's property values to property descriptors.

shouldWriteProperty : string -> Type -> obj -> bool
propertyDescriptors : Map<string, Symbol>
target : 'a
Returns: Map<string, Symbol>

Type something to start searching.