diff --git a/index.html b/index.html index 6e4a9f8..f9109ec 100644 --- a/index.html +++ b/index.html @@ -9,25 +9,37 @@

@ me (aidanprattewart@protonmail.com) if you have any errors, with console output please.

-

+

 
 

Docs

-

Lambda/Function Syntax

-named function (added to scope, not applied): (swap; a b -> b a) +

Lambda Syntax

+lambda: a b -> b a +parensed lambda: (a -> a) +

Let-In Syntax

+not called immediately; call-by-name
-can be called later like: 1 2 swap +let: (name; value1 value2) N.B. when called, applies (pushes) both values to the stack
-unnamed function, applied immediately: 1 2 3 (a b c -> a b c) +example named function: (++; x -> x 1 +) +

Pairings

+1 2 pair evaluates to {1, 2}
-when lambdas return, they return entire stacks, which are sequentially applied back onto the stack -

Partial Application

-1 + will push a partially-applied function onto the stack +can call fst and snd on pairs +

Partials

+'+ pushes (not applies) a closure onto the stack
-this could be called with: 1 + (partial -> 2 partial) -

Pairs

-pairs of 2 values can be created with pair +1 + is a partially applied function/closure +

Type Literals

+Essentialy strings.
-they can be deconstructed using fst or snd +Example useage: "1 "int coerce 1 + +

Equality

+Internaly JS-based, derived for all objects, pushes lambdas representing true and false onto the stack. +For example: "true-option "false-option val1 val2 == +

Examples

+factorial: (!; x -> 1 '(-> x 1 - ! x *) x 0 ==) +
+fold (stops at type literal "stop): (fold; x acc fn -> '(-> acc) '(-> x acc fn 'fn fold) 'x \"stop ==)

\ No newline at end of file