Struct polytype::Arrow [] [src]

pub struct Arrow {
    pub arg: Box<Type>,
    pub ret: Box<Type>,
}

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));

Fields

Methods

impl Arrow
[src]

[src]

[src]

Get all arguments to the function, recursing through curried functions.

[src]

Get the return type of the function, recursing through curried function returns.

Trait Implementations

impl Debug for Arrow
[src]

[src]

Formats the value using the given formatter.

impl Clone for Arrow
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Arrow
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.