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:
- infer the type
t' of data d (for a given normalized data) -- see in TDataInfer
- 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 ▹τ₂ ->
τ₁ <: τ₂.
Wouldn't it be nice to have an instance of operator (for a given statically known type)?
Something that might look like
d instanceof tIf I'm correct, this could be implemented as:
t'of datad(for a given normalized data) -- see inTDataInfert'is a subtype oft-- see inRSubtypeI 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 ▹τ₂ -> τ₁ <: τ₂.