Struct polytype::Arrow
[−]
[src]
pub struct Arrow { /* fields omitted */ }An arrow (function), curried.
Examples
use polytype::{Type, Arrow}; let arrow = Arrow::new( Type::Variable(0), Arrow::new( Type::Variable(1), Type::Variable(2), ).into(), ); assert_eq!(Vec::from(arrow.args()), vec![&Type::Variable(0), &Type::Variable(1)]); assert_eq!(arrow.returns(), &Type::Variable(2));
Methods
impl Arrow[src]
fn new(arg: Type, ret: Type) -> Arrow[src]
fn args(&self) -> VecDeque<&Type>[src]
Get all arguments to the function, recursing through curried functions.
fn returns(&self) -> &Type[src]
Get the return type of the function, recursing through curried function returns.
Trait Implementations
impl Debug for Arrow[src]
impl Clone for Arrow[src]
fn clone(&self) -> Arrow[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more