Murat Kasimov

More about me

Я language (β)

/Я language (β)/Glossary/Saturation/

Just as regular functions some types could also have arguments:

type Maybe parameter = ...

Supplying parameters to these types is called saturation.

type Saturated = Maybe Unit

In example above we put a space character between to saturate a type. However, if a parameter type also has its own parameters we have to use parentheses:

type Saturated = Maybe ( List Unit )

In order to abolish parentheses you can use a special type operator called T:

type Saturated = Maybe `T` List Unit

Alternatively there is another type operator with higher starting precedence called T'I:

type Saturated = Maybe `T'I` List `T` Unit

Both of those type operators could be stretched to decrease precedence:

type Saturated = Alone `T__` Maybe `T_` List `T` Unit type Saturated = Alone `T'I__` Maybe `T'I_` List `T'I` Unit

Since all operators in Я are left associative it's more convenient to add new functor layers from left to right:

type Saturated = List `T'I` Unit `I'T` Maybe `I'T` Alone

In Я almost all polymorphic types (except Recursive) are functors. Therefore you can form a functor composition if you want to avoid saturation:

type Unsaturated = List `T'TT'I` Maybe type Saturated = List `T'TT'I` Maybe `T'I_` Unit

There is another way to form a new functor from others called Jointing.