Enum gluon_base::types::Kind [] [src]

pub enum Kind {
    Variable(u32),
    Star,
    Function(RcKindRcKind),
}

Kind representation

All types in gluon has a kind. Most types encountered are of the Star (*) kind which includes things like Int, String and Option Int. There are however other types which are said to be "higher kinded" and these use the Function (a -> b) variant. These types include Option and -> which both have the kind * -> * as well as Functor which has the kind (* -> *) -> *.

Variants

Variable(u32)

Representation for a kind which is yet to be infered

Star

The simplest possible kind. All values in a program have this kind.

Function(RcKindRcKind)

Constructor which takes two kinds, taking the first as argument and returning the second

Methods

impl Kind
[src]

fn variable(v: u32) -> RcKind

fn star() -> RcKind

fn function(l: RcKind, r: RcKind) -> RcKind

Trait Implementations

impl Hash for Kind
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl PartialEq for Kind
[src]

fn eq(&self, __arg_0: &Kind) -> bool

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

fn ne(&self, __arg_0: &Kind) -> bool

This method tests for !=.

impl Eq for Kind
[src]

impl Debug for Kind
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for Kind
[src]

fn clone(&self) -> Kind

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Display for Kind
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.