[−][src]Struct gluon_check::typecheck::Typecheck
Struct which provides methods to typecheck expressions.
Methods
impl<'a> Typecheck<'a>
[src]
pub fn new(
module: String,
symbols: &'a mut Symbols,
environment: &'a (dyn TypecheckEnv<Type = ArcType> + 'a),
interner: &TypeCache<Symbol, ArcType>,
metadata: &'a mut FnvMap<Symbol, Arc<Metadata>>
) -> Typecheck<'a>
[src]
module: String,
symbols: &'a mut Symbols,
environment: &'a (dyn TypecheckEnv<Type = ArcType> + 'a),
interner: &TypeCache<Symbol, ArcType>,
metadata: &'a mut FnvMap<Symbol, Arc<Metadata>>
) -> Typecheck<'a>
Create a new typechecker which typechecks expressions in module
pub fn typecheck_expr(
&mut self,
expr: &mut SpannedExpr<Symbol>
) -> Result<ArcType, Error>
[src]
&mut self,
expr: &mut SpannedExpr<Symbol>
) -> Result<ArcType, Error>
Typecheck expr
. If successful the type of the expression will be returned and all
identifiers in expr
will be filled with the inferred type
pub fn typecheck_expr_expected(
&mut self,
expr: &mut SpannedExpr<Symbol>,
expected_type: Option<&ArcType>
) -> Result<ArcType, Error>
[src]
&mut self,
expr: &mut SpannedExpr<Symbol>,
expected_type: Option<&ArcType>
) -> Result<ArcType, Error>
Trait Implementations
impl<'a> TypeContext<Symbol, ArcType<Symbol>> for Typecheck<'a>
[src]
fn intern(&mut self, typ: Type<Symbol, RcType>) -> RcType
fn builtin(&mut self, typ: BuiltinType) -> RcType
fn forall(&mut self, params: Vec<Generic<Symbol>>, typ: RcType) -> RcType
fn with_forall(&mut self, typ: RcType, from: &RcType) -> RcType where
Symbol: Clone + Eq + Hash,
RcType: TypeExt<Id = Symbol> + Clone,
Symbol: Clone + Eq + Hash,
RcType: TypeExt<Id = Symbol> + Clone,
fn array(&mut self, typ: RcType) -> RcType
fn app(&mut self, id: RcType, args: AppVec<RcType>) -> RcType
fn variant(&mut self, fields: Vec<Field<Symbol, RcType>>) -> RcType
fn poly_variant(
&mut self,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
&mut self,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
fn effect(&mut self, fields: Vec<Field<Symbol, RcType>>) -> RcType
fn poly_effect(
&mut self,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
&mut self,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
fn record(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, RcType>>>,
fields: Vec<Field<Symbol, RcType>>
) -> RcType
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, RcType>>>,
fields: Vec<Field<Symbol, RcType>>
) -> RcType
fn poly_record(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, RcType>>>,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, RcType>>>,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
fn extend_row(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, RcType>>>,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, RcType>>>,
fields: Vec<Field<Symbol, RcType>>,
rest: RcType
) -> RcType
fn generic(&mut self, typ: Generic<Symbol>) -> RcType
fn skolem(&mut self, typ: Skolem<Symbol>) -> RcType
fn variable(&mut self, typ: TypeVariable) -> RcType
fn alias(
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: RcType
) -> RcType
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: RcType
) -> RcType
fn ident(&mut self, id: Symbol) -> RcType
fn projection(&mut self, id: AppVec<Symbol>) -> RcType
fn builtin_type(&mut self, typ: BuiltinType) -> RcType
fn new_alias(
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: RcType
) -> Alias<Symbol, RcType>
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: RcType
) -> Alias<Symbol, RcType>
fn new_data_alias(
&mut self,
data: AliasData<Symbol, RcType>
) -> Alias<Symbol, RcType>
&mut self,
data: AliasData<Symbol, RcType>
) -> Alias<Symbol, RcType>
fn alias_group(
&mut self,
group: Vec<AliasData<Symbol, RcType>>
) -> Vec<Alias<Symbol, RcType>>
&mut self,
group: Vec<AliasData<Symbol, RcType>>
) -> Vec<Alias<Symbol, RcType>>
fn hole(&mut self) -> RcType
fn opaque(&mut self) -> RcType
fn error(&mut self) -> RcType
fn array_builtin(&mut self) -> RcType
fn empty_row(&mut self) -> RcType
fn function_builtin(&mut self) -> RcType
fn string(&mut self) -> RcType
fn char(&mut self) -> RcType
fn byte(&mut self) -> RcType
fn int(&mut self) -> RcType
fn float(&mut self) -> RcType
fn unit(&mut self) -> RcType
fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T where
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
[src]
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
fn tuple_<S, I>(&mut self, symbols: &mut S, elems: I) -> Type<Id, T> where
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
[src]
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
fn function<I>(&mut self, args: I, ret: T) -> T where
I: IntoIterator<Item = T>,
T: Clone,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
[src]
I: IntoIterator<Item = T>,
T: Clone,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
fn function_implicit<I>(&mut self, args: I, ret: T) -> T where
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
[src]
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T where
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
[src]
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,