2015-09-10 15:26:19 +00:00
|
|
|
pub enum Expr<'var, VAR> {
|
|
|
|
Let(Box<Expr<'var, VAR>>,
|
2019-05-28 18:46:13 +00:00
|
|
|
Box<dyn for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR> + 'var>)
|
2015-09-10 15:26:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn add<'var, VAR>
|
|
|
|
(a: Expr<'var, VAR>, b: Expr<'var, VAR>) -> Expr<'var, VAR> {
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
2018-03-06 10:22:24 +00:00
|
|
|
pub fn let_<'var, VAR, F: for<'v> Fn(Expr<'v, VAR>) -> Expr<'v, VAR>>
|
2015-09-10 15:26:19 +00:00
|
|
|
(a: Expr<'var, VAR>, b: F) -> Expr<'var, VAR> {
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-10-19 16:58:44 +00:00
|
|
|
let ex = |x| { //~ ERROR type annotations needed
|
|
|
|
let_(add(x,x), |y| {
|
2015-09-14 23:35:25 +00:00
|
|
|
let_(add(x, x), |x|x)})};
|
2015-09-10 15:26:19 +00:00
|
|
|
}
|