Overview
If you already had a chance to take a look at examples you could be overwhelmed by these unknown circles, dots, arrows and loops. On this page I’ll explain the main idea behind them. It’s actually a system of composable tokens that let you read any code unambiguously.
Operators list
Some available operators (without mentioning all possible compositions between them):
he ⋅ ho ⋅ ha ⋅ hu ⋅ lo ⋅ lu ⋅ la ⋅ yi ⋅ yo ⋅ ya ⋅ yu ⋅ yp ⋅ ys ⋅ yio ⋅ yai ⋅ yok ⋅ yokl
(In case you want to get an information about any operator, you don’t have to go here, just use a search bar - it works.)
Formula
Operators could be decomposed into simpler glyps (just like hanzi). This is a simplified formula to bake a working operator:
Varieties
Since everything in Я is built on natural transformations (well, there are rare unnatural ones), we operate on a notion of functors. To bake an operator we need too choose the type of a functor and its argument.
Functor types:
Argument types:
Argument types, but only for Yoneda functors (monoidal):
Argument types, but only for Hom functors:
We can try to combine them together:
Additionaly, we can add Kleisli arrows (but only for Yoneda functors):
Associativity
All operators are left associative. It means that you will read the code from left to right as you get used to (until you are from Middle East region).
Composition
Many operators are composed from other ones, you need to put '
between them. You are free to try to compose any operators to each other - highly likely you’re going to succeed.
Precedence
The length of the symbol define its precedence. Longer glyphs takes less precedence. So it will be easily to figure out how expressions are related to each other visually.
How to calculate precedence? Here is the formula:
In case of operators composition like ho’yokl take the first operator precedence - ho which is 9
.
If you want to decrease precedence of any operator - just add _
symbol to the end, and it should be expanded visually:
Type operators
To make code look more readable, there are some type operators you can use as well: