Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,19 @@
let a => import 'arrays';
let s => import 'stream';
let vmath f v1 v2 =>
s.zip (a.stream v1) (a.stream v2)
-> s.map (@ m v =>
let [v1 v2] => v;
f (v1 { == s.end => 0 }) (v2 { == s.end => 0 });
)
-> s.collect
;
let smath f scalar vector => a.stream vector -> s.map (f scalar) -> s.collect;
let v+ => vmath +;
let v- => vmath -;
let s* => smath *;
let s/ => smath /;

View file

@ -0,0 +1,2 @@
v+ [1; 2; 3] [2; 5; 2] -- io.writeln io.stdout;
s* 3 [1; 5; 10] -- io.writeln io.stdout;