Skip to content

InstanceOf operator #95

@jeromesimeon

Description

@jeromesimeon

Wouldn't it be nice to have an instance of operator (for a given statically known type)?
Something that might look like d instanceof t
If I'm correct, this could be implemented as:

  1. infer the type t' of data d (for a given normalized data) -- see in TDataInfer
  2. check whether t' is a subtype of t -- see in RSubtype

I believe this is a sound procedure thanks to the lovely theorem in TDataInfer:

  Theorem infer_data_type_least {d τ₁ τ₂} : 
    infer_data_type d = Some τ₁ ->
    d ▹τ₂ ->
    τ₁ <: τ₂.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions