| Line 1: |
Line 1: |
| − | a1=LAMBDACALCULUS(
| + | ==WIP Feb 2024== |
| − | function lc(){
| + | <pre> |
| − | return(B(COS,SIN))
| |
| − | }
| |
| − | );
| |
| − | a1(34)
| |
| − | - something like that. it does not appear to be working for now.
| |
| − | -provide bird names too. function generators.
| |
| | | | |
| − | -zprod seems to have extra lines on code expansion.
| |
| − |
| |
| − | a1=LAMBDACALCULUS(
| |
| − | ()=>B(SIN,COS)
| |
| − | )
| |
| − | a1(23)
| |
| − |
| |
| − | //b(sin)(cos) etc?
| |
| − |
| |
| − | // this works
| |
| − | a1=LAMBDACALCULUS(
| |
| − | function ()
| |
| − | {
| |
| − | return(B(SIN)(COS))
| |
| − | }
| |
| − | );
| |
| − | a1(45)
| |
| − |
| |
| − |
| |
| − | a1=LAMBDACALCULUS(
| |
| − | ()=>B(SIN)(COS)
| |
| − | );
| |
| − | a1(45)
| |
| − |
| |
| − | // easier notations
| |
| − | λ=LAMBDACALCULUS;
| |
| − | a1=λ(()=>B(SIN)(COS))
| |
| − | a1(45)
| |
| − |
| |
| − |
| |
| − | // easier notations
| |
| − | λ=LAMBDACALCULUS;
| |
| − | a1=λ(()=>BLUEBIRD(SIN)(COS))
| |
| − | a1(45)
| |
| − |
| |
| − | // easier notations
| |
| − | λ=LAMBDACALCULUS;
| |
| − | a1=λ(function(){return(BLUEBIRD(SIN)(COS))})
| |
| − | a1(45)
| |
| − |
| |
| − | // easier notations
| |
| − | λC=LAMBDACALCULUS;
| |
| − | a1=λC(()=>BLUEBIRD(SIN)(COS));
| |
| − | a1(45)
| |
| | | | |
| | | | |
| Line 59: |
Line 9: |
| | SIN(COS(45deg)) | | SIN(COS(45deg)) |
| | | | |
| − | // Amar Shah talk on functional combinators etc
| + | Parts(1..100,20Parts(1..100,20)) |
| − | //fog Over Atop Compositions
| |
| − | //Case Convert
| |
| − | //Unique Mask
| |
| − | | |
| − | Parts(1..100,20) | |
| − | Parts(1..100,20)
| |
| | | | |
| | [1..10].zip([11..20]) | | [1..10].zip([11..20]) |
| − | //seems different from
| + | seems different from |
| | Zip([1..10],[11..20]) | | Zip([1..10],[11..20]) |
| | Shuffle(1..10) | | Shuffle(1..10) |
| Line 82: |
Line 26: |
| | | | |
| | | | |
| − | //should we combinatorial argument Parts?
| + | should we combinatorial argumment Parts? |
| | | | |
| | Length(1..10) | | Length(1..10) |
| Line 116: |
Line 60: |
| | | | |
| | | | |
| − | a1=
| |
| − | λC(
| |
| − | function ()
| |
| − | {
| |
| − | //BLUEBIRD(SIN)(COS));
| |
| − | return(B(Parts)(Length))
| |
| − | }
| |
| − | )
| |
| − | a1(1..100);
| |
| − |
| |
| − | // something along these lines.
| |
| − | a1=
| |
| − | λC(
| |
| − | function ()
| |
| − | {
| |
| − | //BLUEBIRD(SIN)(COS));
| |
| − | return(B(Parts)(Length))
| |
| − | }
| |
| − | )
| |
| − | a1(1..100);
| |
| | | | |
| | B=A=1..10; | | B=A=1..10; |
| Line 176: |
Line 100: |
| | | | |
| | ("testings fasdf asdf asd sdf"#["s"]) ~ | | ("testings fasdf asdf asd sdf"#["s"]) ~ |
| | + | |
| | + | "testings fasdf asdf asd sdf"#[/[a-g]/] |
| | + | |
| | | | |
| | | | |
| | 𓈰=|3,4,[4]|; | | 𓈰=|3,4,[4]|; |
| | 𓈰|*|3443 | | 𓈰|*|3443 |
| − |
| |
| − | λC(
| |
| − | ()=>
| |
| − | {
| |
| − | // Lambda Code Here
| |
| − | }
| |
| − | )
| |
| − |
| |
| − |
| |
| − |
| |
| − | a1=λC(
| |
| − | ()=>
| |
| − | {
| |
| − | return(B(SIN)(COS))
| |
| − | }
| |
| − | );
| |
| − | a1(45deg)
| |
| | | | |
| | | | |
| Line 209: |
Line 119: |
| | | | |
| | 1..100|x^2| | | 1..100|x^2| |
| | + | |
| | | | |
| | //https://www.youtube.com/watch?v=59vAjBS3yZM&t=113 | | //https://www.youtube.com/watch?v=59vAjBS3yZM&t=113 |
| Line 216: |
Line 127: |
| | // Composition Intuition | | // Composition Intuition |
| | | | |
| | + | |
| | + | (1..100)|+|; |
| | + | (1..100)|+|; |
| | + | SUM(1..100) |
| | | | |
| | 1..10|..|1..10 | | 1..10|..|1..10 |
| Line 258: |
Line 173: |
| | | | |
| | | | |
| | + | function DisplayDataHint(anyhint,SomeStayOn, KeepCaseSensitive) |
| | + | SomeStayOn // gives dark css for tooltip |
| | | | |
| | + | |
| | + | (1..10)#/3/ |
| | | | |
| | (1..10)#3 | | (1..10)#3 |
| Line 265: |
Line 184: |
| | (1..10)#[0] | | (1..10)#[0] |
| | (1..10)#0..5 | | (1..10)#0..5 |
| − | //((1..10)#"shuffle")() // should this work? | + | (1..10)#3..5 |
| | + | // now gives dates |
| | + | ((1..10)#"shuffle")() |
| | + | // should this work? |
| | + | |
| | + | (1..10)#[3,[0,1]] |
| | + | (1..10)#[3,[SIN,COS]] |
| | + | (1..10)#[SIN,COS] |
| | + | // important distinction. |
| | + | (1..10)#[SIN,COS] |
| | + | // calling function at first level is for *filtering* like ISNUM etc predicate function. |
| | + | (1..10)#[3,[SIN]] |
| | + | // calling function at first level is for computing. |
| | + | (1..10)#[3,[x=>x>4]] |
| | + | (1..10)#(x=>x>4) |
| | + | |
| | + | (1..10)#[3,[x=>x>4]] // here predicate function will use entire left array. |
| | + | (1..10)#[x=>x>4] // this is predicate application |
| | + | (1..10)#(x=>x>4) // straight evaluation of function. In this case will give false true masks. |
| | + | (1..10)#(SIN) // straight evaluation of function. |
| | + | |
| | + | (1..10)#(x=>x>4) // true false mask flags |
| | + | (1..10)#[x=>x>4] // filters by function as predicate |
| | + | (1..10)#[[x=>x>4]] // applied to entire left array. |
| | + | |
| | + | (1..10)#[[x=>x^3]] |
| | + | (1..10)#(x=>x^3) |
| | + | |
| | + | |
| | + | // note the way predicates and functions are applied intelligently based on how the arrays are loaded to do the application |
| | + | (1..10)#[/[3,4]/] |
| | + | (1..10)#[/[3,4]/] |
| | + | (1..10)#[/\d/] |
| | + | (1..10)#[/^\d$/] |
| | + | (1..100)#[/^\d\d$/] |
| | + | (1..100)#(fn:=x>34) |
| | + | (1..100)#([fn:=x>34]) |
| | + | (1..100)#(fn:=x>34) |
| | + | (1..100)#[[fn:=x>34]] |
| | + | (1..100)#/^\d\d$/ // flags of predicate or fn application on left. on each element. |
| | + | |
| | + | |
| | + | |
| | + | |
| | + | fn:=x+45; |
| | + | fn(34) |
| | + | |
| | + | |
| | | | |
| − | // #a-z stopped working. now ok.
| + | #a-z stopped working. |
| | (#a-z)#/a/ | | (#a-z)#/a/ |
| | (#a-z) | | (#a-z) |
| Line 285: |
Line 251: |
| | cars= | | cars= |
| | { | | { |
| − | name:"andrew", | + | name:"lyla", |
| | age:25 | | age:25 |
| | | | |
| Line 294: |
Line 260: |
| | cars#/nam/ | | cars#/nam/ |
| | cars#((x,i)=>25==x) | | cars#((x,i)=>25==x) |
| − | cars#((x,i)=>"andrew"==x) | + | cars#((x,i)=>"lyla"==x) |
| | | | |
| | cars= | | cars= |
| | { | | { |
| − | name:"andrew", | + | name:"lyla", |
| | age:25, | | age:25, |
| | namaste:true | | namaste:true |
| Line 310: |
Line 276: |
| | ∏|4|# | | ∏|4|# |
| | ∏|4,2,3,5,1..10|# | | ∏|4,2,3,5,1..10|# |
| − | ∏|4,2,3,5,1..10|#1 | + | ∏|4,2,3,5,1..10|#1 |
| | + | |
| | + | |
| | + | // (EQ@Σ)("RRGWRR"#,"RBBWWW"#) |
| | + | |
| | + | [1,2,3]|*|[[2],[3],[4]] |
| | + | |
| | + | 1..10@[SIN,COS,"x^2"]; |
| | + | |
| | + | 03/01/2024 |
| | + | |
| | + | |
| | + | |
| | + | // did not parse |
| | + | ("RRGWRR"#)|x==y|("RBBWWW"#) |
| | + | ("RRGWRR"#)|.==|("RBBWWW"#) |
| | + | |
| | + | // works |
| | + | ("RRGWRR"#)|MATRIXEQUAL|("RBBWWW"#) |
| | + | |
| | + | |
| | + | |
| | + | |
| | + | //new adds |
| | + | |
| | + | MS(3)|++|MS(3) |
| | + | |
| | + | (1..10)#[0] |
| | + | (1..10)#[1,2] |
| | + | (1..10)#[[1,2]] |
| | + | |
| | + | |
| | + | // https://thecodest.co/blog/power-of-functional-programming-in-javascript-part-2-combinators/ |
| | + | // combinators |
| | + | // function trains |
| | + | |
| | + | //eval([COS,SIN,TAN,SUM].$fnx())(45) |
| | + | [COS,SIN,TAN,SUM].$fnx() |
| | + | [COS,SIN,TAN,SUM].$fnx()(45) |
| | + | [COS,SIN,TAN,SUM].$atop()(45) |
| | + | |
| | + | [COS,SIN].$atop() |
| | + | |
| | + | |
| | + | [COS,SIN,TAN,SUM].$atop()(45) |
| | + | [COS,SIN,TAN,SUM].$atop()(22..45) |
| | + | [COS,SIN,TAN].$atop()(22..45) |
| | + | [SUM,[SIN,TAN]].$atop()(22..45) |
| | + | [[SIN,TAN],SUM].$atop()(22..45) // more like the way to operate |
| | + | |
| | + | [[SIN,TAN],SUM].$fnx()(22..45) |
| | + | ([[SIN,TAN],SUM].$fnx())+"" |
| | + | |
| | + | ([[SIN,TAN],SUM].$fnx())(45..90) |
| | + | |
| | + | ([[[SIN],[TAN]],SUM].$fnx())(45..90) |
| | + | ([[[SIN],[TAN]],SUM].$fnx())(49,39) |
| | + | ([[[SIN],[TAN]],SUM].$fnx())(49,34) |
| | + | |
| | + | ([[[SIN],TAN],SUM].$fnx())(49,34) |
| | + | ([[[SIN],TAN],SUM].$fnx())+"" |
| | + | ([[[SIN],TAN,[COS]],SUM].$fnx())+"" |
| | + | ([[[SIN],[TAN],[COS]],SUM].$fnx())+"" |
| | + | ([[SIN,TAN,[COS]],SUM].$fnx())+"" |
| | + | |
| | + | [DIVIDE,SUM,Length].$fork() |
| | + | |
| | + | [DIVIDE,SUM,Length].$fork()(1..100) |
| | + | [DIVIDE,SUM,Length].$fork()([5, 3, 2, 8, 4, 2]) |
| | + | |
| | + | $Fork([DIVIDE,Length,SUM])([2,3,4,5]) |
| | + | |
| | + | [DIVIDE,SUM,Length].$fork()([5, 3, 2, 8, 4, 2]) |
| | + | |
| | + | [SIN,COS,TAN].$sequence()(1..10) |
| | + | // does not have to return values. just need to run them in sequence, no array result expected. |
| | + | // if needed, could have a wrap functionality to fnx with an array member doing that. |
| | + | |
| | + | [SIN,COS,TAN].$pipe()(1..10) |
| | + | [SIN,COS,TAN].$compose()(1..10) |
| | + | |
| | + | [SIN,COS,TAN].$tap()(1..10) |
| | + | // done: with itself call in parallel. |
| | + | // (function(a){return(ITSELF(TAN(COS(SIN(a)))))}) |
| | + | // how to reflect ITSELF a in this. Maybe another indicator to capture and reflect? |
| | + | // and how do we wrap a set into an array? |
| | + | |
| | + | [SIN,COS,TAN].$tap()(10) |
| | + | |
| | + | [x=>x>4?1,x=>x>8?2,x=>x>14?3].$alternation()(10) |
| | + | |
| | + | [x=>x>4?1,x=>x>8?2,x=>x>14?3].$alternation()(10) |
| | + | |
| | + | [x=>x>4?1,x=>x>8?2,x=>x>14?3].$alternation()+"" |
| | + | |
| | + | [x=>x<4?1,x=>x<8?2,x=>x<14?3].$alternation()(10) |
| | + | |
| | + | |
| | + | [].$combinators() |
| | + | |
| | + | |
| | + | |
| | + | [SIN,COS].$combinators("B")(3) |
| | + | |
| | + | // display message was on editor.on handler. |
| | + | [SIN,COS].$combinators("B")(3) |
| | + | [].$combinators("I")(3) |
| | + | [SIN,COS].$combinators("K")(3) // gives SIN as it ignore COS etc. constant |
| | + | [3,43].$combinators("K") |
| | + | |
| | + | |
| | + | [DIVIDE,SUM,Length].$combinators("Φ")(1..10) |
| | + | |
| | + | // errors on this one. |
| | + | [DIVIDE,SUM].$combinators("Σ")(1..10) |
| | + | |
| | + | // not working. as a is not generating a function. |
| | + | [SIN,COS].$combinators("Σ")(1..10) |
| | + | |
| | + | </pre> |