-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
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 datad(for a given normalized data) -- see inTDataInfer - check whether
t'is a subtype oft-- see inRSubtype
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 ▹τ₂ ->
τ₁ <: τ₂.