mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-09-17 14:47:21 +03:00
Update combinators test and improve docs
This commit is contained in:
parent
37fdd38d7b
commit
30d7888d23
@ -15,7 +15,8 @@ impl Book {
|
||||
///
|
||||
/// The floating algorithm follows these rules:
|
||||
/// - Recursively float every child term.
|
||||
/// - Extract if it is a combinator and not is a safe term.
|
||||
/// - Extract if it is a combinator and is not a safe term.
|
||||
/// See [`Term::is_safe`] for what is considered safe here.
|
||||
pub fn float_combinators(&mut self) {
|
||||
let mut combinators = Combinators::new();
|
||||
|
||||
|
@ -12,12 +12,14 @@
|
||||
|
||||
(qux) = {0 qux}
|
||||
|
||||
(clax) = (λx x λa λb λc λd (clax d))
|
||||
|
||||
(tup) = (tup, 1, 0)
|
||||
|
||||
(list) = [0 list]
|
||||
|
||||
(A x) = (let {a b} = A; @c (a b c) x)
|
||||
(A x) = (let {a b} = A; λc (a b c) x)
|
||||
|
||||
(B x) = (let (a, b) = B; @c (a b c) x)
|
||||
(B x) = (let (a, b) = B; λc (a b c) x)
|
||||
|
||||
(Main) = list
|
||||
|
@ -12,6 +12,8 @@ input_file: tests/golden_tests/desugar_file/combinators.hvm
|
||||
|
||||
(qux) = {0 qux}
|
||||
|
||||
(clax) = (λa a clax$C0)
|
||||
|
||||
(tup) = (tup, 1, 0)
|
||||
|
||||
(list) = (List.cons 0 list$C0)
|
||||
@ -32,4 +34,6 @@ input_file: tests/golden_tests/desugar_file/combinators.hvm
|
||||
|
||||
(List.ignore$C0) = #List λ* #List λd (List.ignore d List.ignore)
|
||||
|
||||
(clax$C0) = λ* λ* λ* λe (clax e)
|
||||
|
||||
(list$C0) = (List.cons list List.nil)
|
||||
|
Loading…
Reference in New Issue
Block a user