Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWhiting committed Oct 9, 2024
1 parent 72ddb24 commit b8b671e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/async/file-js.kk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ extern ext/read-file(path: string): io-noexn any
fun js/read-file(path: string): <io,async> string
Jspromise(read-file(path)).wrap.unsafe-as-string

// In VSCode Cmd/Ctrl+Shift+P Then select Koka: Compilation target, and switch to nodejs, prior to running this
fun main()
val res = try
js/read-file("examples/async/file-js.kk").println
Expand Down
1 change: 1 addition & 0 deletions examples/async/timer.kk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import std/async
import std/time/duration
import std/time/timestamp

// In VSCode Cmd/Ctrl+Shift+P Then select Koka: Compilation target, and switch to nodejs, prior to running this
fun main()
val res = try
val x = ref(0)
Expand Down
6 changes: 3 additions & 3 deletions std/fixpoint/fixpoint-memo.kk
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ fun cache(f: () -> <pure,cache<s,c>|e> b, ?order2: (s, s) -> pure order2<s>, .?c
fun update(s, c)
match deps.lookup(s)
Just(resumes) ->
trace("Updating " ++ resumes.length.show ++ " deps for " ++ s.show ++ " with " ++ c.c/show)
// trace("Updating " ++ resumes.length.show ++ " deps for " ++ s.show ++ " with " ++ c.c/show)
resumes.list/foreach(fn(res) {res(c); ()})
Nothing -> ()
val do =
with handler
fun add-state(s)
m := m.set(s, bottom)
fun add-result(s, c)
trace("Adding result for " ++ s.s/show ++ " " ++ c.c/show)
// trace("Adding result for " ++ s.s/show ++ " " ++ c.c/show)
match m.lookup(s)
Just(r') ->
val (changed, r'') = join(r', c)
Expand All @@ -37,7 +37,7 @@ fun cache(f: () -> <pure,cache<s,c>|e> b, ?order2: (s, s) -> pure order2<s>, .?c
fun is-cached(s)
m.contains(s)
ctl depend(s)
trace("Adding dep for " ++ s.s/show)
// trace("Adding dep for " ++ s.s/show)
match deps.lookup(s)
Just(resumes) ->
val ress = Cons(fn(r) resume(r), resumes)
Expand Down

0 comments on commit b8b671e

Please sign in to comment.