Murat Kasimov

More about me

Я language (β)

/Я language (β)/Glossary/Subtyping/

Some primitives could be wrapped, unwrapped and rewrapped in order to be used as other ones based on structural subtyping relations.

> supertype : target i ( Supertype i ) > subtype : target ( Supertype i ) i

You can think of subtypes as wrappers and supertypes as contents.

Basetype is a composition of supertypes that leads either to Arrow, Product or Sum:

> basetype : target i ( Basetype i ) > boundtype : target ( Basetype i ) i

Both Supertype/Basetype related morphisms can be used in operator compositions:

`st` : target i ( Supertype i ) `bt` : target i ( Basetype i )

There are some non-trivial subtyping relations:

`st` : ( i `P` ( ii `P` iii ) ) `AR_____` ( i `P` ii `P` iii ) `st` : ( i `S` ( ii `S` iii ) ) `AR_____` ( i `S` ii `S` iii ) `st` : Unit `AR` i `AR_____` i

There are special wrappers that don't actually wrap anything:

Same : i `AR______` i Null : Void `AR` Void Only : Unit `AR` Unit