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