Conversation

Hmm just gotta be careful here, forall is not a lambda - itโ€™s the type of a lambda! It gets a bit weird in Rust as they are only used within trait constraints, and you never see the corresponding lifetime functions, nor can you construct them yourself.
1
1
(was meant to be `assert_eq!`) See how `for` lets you write a `fn` type that depends on the type parameter `T` that is applied. Note that this is actually very similar to the `fn` type, just at the type level, and implicit.
2
To use this for lifetimes, which is a bit like what Rust's trait resolution is doing, imagine being able to write something like: let id_str : for<'a> fn(x: &'a str) -> &'a str = <'a>|x: &'a str| -> &'a str { x }; assert_eq!(id_str::<'static>("hi"), "hi");