-
Notifications
You must be signed in to change notification settings - Fork 61
Add unique and pivot_table functions to BuiltinsList #2005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
e875f5c
a6ab7e5
14046c8
c7fc370
a4b832d
32052fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2880,6 +2880,302 @@ let go: ([?], [?], [?]) -> [?] = | |||||
| Fresh.(Exp.(var("zip"))); | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| str: {|fix unique -> fun xs -> | ||||||
| fold_left(xs, fun (seen, x) -> if mem(seen, x) then seen else seen @ [x], [])|}, | ||||||
| name: "unique", | ||||||
| arg: List(unknown(Internal)), | ||||||
| ret: List(unknown(Internal)), | ||||||
| imp: { | ||||||
| Fresh.( | ||||||
| Exp.( | ||||||
| fix_f( | ||||||
| Pat.var("unique"), | ||||||
| fn( | ||||||
| Pat.var("xs"), | ||||||
| ap( | ||||||
| Forward, | ||||||
| var("fold_left"), | ||||||
| tuple([ | ||||||
| var("xs"), | ||||||
| fn( | ||||||
| Pat.tuple([Pat.var("seen"), Pat.var("x")]), | ||||||
| if_( | ||||||
| ap( | ||||||
| Forward, | ||||||
| var("mem"), | ||||||
| tuple([var("seen"), var("x")]), | ||||||
| ), | ||||||
| var("seen"), | ||||||
| ap( | ||||||
| Forward, | ||||||
| var("append"), | ||||||
| tuple([var("seen"), list_lit([var("x")])]), | ||||||
| ), | ||||||
| ), | ||||||
| None, | ||||||
| None, | ||||||
| ), | ||||||
| list_lit([]), | ||||||
| ]), | ||||||
| ), | ||||||
| None, | ||||||
| None, | ||||||
| ), | ||||||
| None, | ||||||
| ) | ||||||
| ) | ||||||
| ); | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| str: {hazel|fix pivot_table -> fun (table, new_col, index, value) -> | ||||||
|
||||||
| str: {hazel|fix pivot_table -> fun (table, new_col, index, value) -> | |
| str: {hazel|fix pivot_table -> fun (table, index, new_col, value) -> |
Uh oh!
There was an error while loading. Please reload this page.