Skip to content

Commit

Permalink
maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
LuKuangChen committed Oct 2, 2024
1 parent 0130a3a commit 2c935b8
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 52 deletions.
12 changes: 6 additions & 6 deletions docs/main.js

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/runtime.res
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ let deltaEq = (cmp, v, vs): value => {

let arityOf = p =>
switch p {
| Arith(Add) => RTArity.AtLeast(1)
| Maybe => RTArity.Exactly(0)
| Arith(Add) => AtLeast(1)
| Arith(Sub) => AtLeast(2)
| Arith(Mul) => AtLeast(1)
| Arith(Div) => AtLeast(2)
Expand Down Expand Up @@ -684,6 +685,7 @@ and make_vector = (vs: list<value>) => {
}
and delta = (ann, p, vs) =>
switch (p, vs) {
| (Maybe, list{}) => return(Con(Lgc(Math.random() >= 0.5)))
| (Arith(Add), list{v, ...vs}) => return(deltaNum1((a, b) => a +. b, v, vs))
| (Arith(Sub), list{v1, v2, ...vs}) => return(deltaNum2((a, b) => a -. b, v1, v2, vs))
| (Arith(Mul), list{v, ...vs}) => return(deltaNum1((a, b) => a *. b, v, vs))
Expand Down

0 comments on commit 2c935b8

Please sign in to comment.