Skip to content

Commit

Permalink
try a tree shaking algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
CrowdHailer committed Oct 10, 2022
1 parent d97e121 commit 5d64ada
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions eyg/src/eyg/entry.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import eyg/typer
import eyg/typer/monotype as t
import eyg/editor/editor


fn update(page, interrupt, display, on_click) {
io.debug(page)
display(page)
Expand All @@ -25,9 +24,14 @@ fn b(args) {
Ok(args)
}

fn tree() {
r.Function(p.Variable("x"), e.tuple_([e.variable("x"),e.variable("x")]), map.new(), None)
}
fn tree() {
r.Function(
p.Variable("x"),
e.tuple_([e.variable("x"), e.variable("x")]),
map.new(),
None,
)
}

// uses default builtin that need moving out of effectful
// has an entry point key should eventually be a hash
Expand All @@ -44,12 +48,12 @@ pub fn interpret_client(source, key, display, on_click) {
let #(xtyped, typer) =
typer.expand_providers(typed, typer, [])
// Running the interpreter kills the client
// assert Ok(term) = effectful.eval(editor.untype(xtyped))
// io.debug(term)
// assert Ok(term) = effectful.eval(editor.untype(xtyped))
// io.debug(term)
|> io.debug
io.debug("expanded")
effectful.eval_call(tree(), r.Binary("nothing exciting"), effectful.real_log)
|> io.debug
effectful.eval_call(tree(), r.Binary("nothing exciting"), effectful.real_log)
|> io.debug
// // TODO make an AST the requires rendering
// term
}

0 comments on commit 5d64ada

Please sign in to comment.