From 3aa147c1b928ebb5a4eb8841d967ec0c980653b8 Mon Sep 17 00:00:00 2001 From: JonoCode9374 <36217120+JonoCode9374@users.noreply.github.com> Date: Thu, 26 Dec 2019 13:44:29 +1100 Subject: [PATCH] Update Patterns.md --- Patterns.md | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/Patterns.md b/Patterns.md index ffa0757..157da0c 100644 --- a/Patterns.md +++ b/Patterns.md @@ -1,7 +1,34 @@ # Different Block Patterns +This is a list of how patterns are evaluated within Ket (ekg) + +Nilads: N n Ñ ñ --> Nilads +Singles: S s Š ś --> Monads +Infixes: I i Ī ī --> Dyads + +L L* L& L! --> Left argument -- implicit/whatever is to the left +R R* R& R! --> Right argument -- implicit/whatever is to the left + +`{...}` means that the expressions are blocked together + +`ND` -> `N I R` + +`SN` -> `S(N)` +`Ss` -> `S(s(R))` +`SI` -> `S(R) I R*` + +`IN` -> `L I S` +`IS` -> `L I S(R*)` +`Ii` -> `{L I R} i R*` + +`SNs` -> `S(N)s(R)` +`SNI` -> `S(N) I R` +`SsN` -> `S(s(N))` +`SsŠ` -> `S(s(Š(R)))` +`SsI` -> `S(s(R)) I R*` +`SIN` -> `S(R) I N` +`SIs` -> `S(R) I s(R*)` +`SIi` -> `S(R) I {L* i R*}` + +`INS` -> `L I N S(*R)` + -|Arities|Result| -|-------|------| -|`1,2,1`|`Dyad(Monad1(Arg), Monad2(Arg))`| -|`0,1`|`Monad(Nilad)`| -|`0,2,0`|`Dyad(Nilad1, Nilad2)`|