Macro polytype::arrow
[−]
[src]
macro_rules! arrow { [$x:expr] => { ... }; [$x:expr, $($xs:expr),*] => { ... }; [$x:expr, $($xs:expr,)*] => { ... }; }
Creates an arrow of tp0 → tp1 → ... (convenience for nested
arrows).
This is equivalent to:
ⓘThis example is not tested
Type::arrow(tp0, Type::arrow(tp1, Type::arrow(tp2, ... ) ) )
Examples
#[macro_use] extern crate polytype; use polytype::{Type}; let t = arrow![Type::Variable(0), Type::Variable(1), Type::Variable(2)]; assert_eq!(format!("{}", t), "t0 → t1 → t2"); // Equivalent to: let t_eq = Type::arrow(Type::Variable(0), Type::arrow(Type::Variable(1), Type::Variable(2))); assert_eq!(t, t_eq);