Murat Kasimov

More about me

Я language (β)

/Я language (β)/Glossary/Saturation/

Just as regular functions some types could also have arguments:

: Maybe i

Supplying parameters to these types is called saturation:

: 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:

: Maybe ( List Unit )

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

: ( Maybe `T` List Unit ) ~ ( Maybe ( List Unit ) )

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

: ( Maybe `T'I` List Unit ) ~ ( Maybe ( List Unit ) )

This operator could be stretched to decrease precedence:

: ( Alone `T'I__` Maybe `T'I_` List `T'I` Unit ) ~ ( Alone ( Maybe ( List ( Unit ) ) ) )

Since all operators are left associative you can use flipped version of T'I operator - I'T to avoid stretching so that you can add new functor layers from left to right:

: ( Unit `I'T` List `I'T` Maybe `I'T` Alone ) ~ ( Alone ( Maybe ( List ( Unit ) ) ) )

However this may look uncovenient for many people who get used to syntax with reading/writing functor first. Luckily there is another type operator for composing functors:

: ( Alone `T'TT` Maybe `T'TT` List `T'I_` Unit ) ~ ( Alone ( Maybe ( List ( Unit ) ) ) )

There is slightly different type operator that let you form a functor composition - therefore you can avoid saturation:

: Alone `T'TT'I` Maybe `T'TT'I` List : Supertype ( Alone `T'TT'I` Maybe `T'TT'I` List `T'I_` Unit ) ~ ( Alone `T'TT'I` Maybe `T'I_` List `T'I` Unit ) : Supertype ( Supertype ( Alone `T'TT'I` Maybe `T'TT'I` List `T'I_` Unit ) ) ~ ( Alone ( Maybe ( List ( Unit ) ) ) )

There is another way to form a new functor from others called jointing - they also form functor compositions, but the context of this type depends on exact functors.