Skip to content

Commit

Permalink
Predefine do_insert instead of do_delete in erlang_extraction
Browse files Browse the repository at this point in the history
Because writing the insert function is the second task,
I think it's more beneficial as a hint to predefine the private do_ function there
so that beginners are not stuck on the different order of arguments.
And then we can let the student figure this out on their own for the delete function
  • Loading branch information
michallepicki authored Sep 16, 2023
1 parent 17803e3 commit ea5893d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ pub fn insert(tree: GbTree(k, v), key: k, value: v) -> GbTree(k, v) {
todo
}

pub fn delete(tree: GbTree(k, v), key: k) -> GbTree(k, v) {
fn do_insert(key: k, value: v, tree: GbTree(k, v)) -> GbTree(k, v) {
todo
}

fn do_delete(key: k, tree: GbTree(k, v)) -> GbTree(k, v) {
pub fn delete(tree: GbTree(k, v), key: k) -> GbTree(k, v) {
todo
}

0 comments on commit ea5893d

Please sign in to comment.