diff --git a/compiler-core/checking/src/algorithm/constraint.rs b/compiler-core/checking/src/algorithm/constraint.rs index e366d5d5..d76d7d4e 100644 --- a/compiler-core/checking/src/algorithm/constraint.rs +++ b/compiler-core/checking/src/algorithm/constraint.rs @@ -109,7 +109,7 @@ where Ok(residual) } -#[derive(Clone, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub(crate) struct ConstraintApplication { pub(crate) file_id: FileId, pub(crate) item_id: TypeItemId, @@ -469,7 +469,7 @@ fn match_type( let given_core = &state.storage[given]; match (wanted_core, given_core) { - (_, Type::Variable(Variable::Bound(level))) => { + (_, Type::Variable(Variable::Bound(level, _))) => { if let Some(&bound) = bindings.get(level) { match can_unify(state, wanted, bound) { CanUnify::Equal => MatchType::Match, @@ -552,6 +552,28 @@ fn match_given_type(state: &mut CheckState, wanted: TypeId, given: TypeId) -> Ma match (wanted_core, given_core) { (Type::Unification(_), _) => MatchType::Stuck, + ( + Type::Variable(Variable::Bound(w_level, w_kind)), + Type::Variable(Variable::Bound(g_level, g_kind)), + ) => { + if w_level == g_level { + match_given_type(state, *w_kind, *g_kind) + } else { + MatchType::Apart + } + } + + ( + Type::Variable(Variable::Skolem(w_level, w_kind)), + Type::Variable(Variable::Skolem(g_level, g_kind)), + ) => { + if w_level == g_level { + match_given_type(state, *w_kind, *g_kind) + } else { + MatchType::Apart + } + } + ( &Type::Application(w_function, w_argument), &Type::Application(g_function, g_argument), @@ -668,6 +690,22 @@ fn can_unify(state: &mut CheckState, t1: TypeId, t2: TypeId) -> CanUnify { } } + (&Type::Variable(Variable::Bound(l1, k1)), &Type::Variable(Variable::Bound(l2, k2))) => { + if l1 == l2 { + can_unify(state, k1, k2) + } else { + Apart + } + } + + (&Type::Variable(Variable::Skolem(l1, k1)), &Type::Variable(Variable::Skolem(l2, k2))) => { + if l1 == l2 { + can_unify(state, k1, k2) + } else { + Apart + } + } + _ => Apart, } } @@ -718,6 +756,25 @@ where } } + let mut argument_levels = FxHashSet::default(); + for &(argument, _) in &instance.arguments { + let localized = transfer::localize(state, context, argument); + CollectBoundLevels::on(state, localized, &mut argument_levels); + } + + let mut constraint_variables = FxHashMap::default(); + for &(constraint, _) in &instance.constraints { + let localized = transfer::localize(state, context, constraint); + CollectBoundVariables::on(state, localized, &mut constraint_variables); + } + + for (level, kind) in constraint_variables { + if !argument_levels.contains(&level) && !bindings.contains_key(&level) { + let unification = state.fresh_unification_kinded(kind); + bindings.insert(level, unification); + } + } + let constraints = instance .constraints .iter() @@ -880,7 +937,7 @@ impl<'a> ApplyBindings<'a> { impl TypeFold for ApplyBindings<'_> { fn transform(&mut self, _state: &mut CheckState, id: TypeId, t: &Type) -> FoldAction { match t { - Type::Variable(Variable::Bound(level)) => { + Type::Variable(Variable::Bound(level, _)) => { let id = self.bindings.get(level).copied().unwrap_or(id); FoldAction::Replace(id) } @@ -888,3 +945,53 @@ impl TypeFold for ApplyBindings<'_> { } } } + +/// Collects all bound variable levels from a type. +struct CollectBoundLevels<'a> { + levels: &'a mut FxHashSet, +} + +impl<'a> CollectBoundLevels<'a> { + fn on(state: &mut CheckState, type_id: TypeId, levels: &'a mut FxHashSet) { + fold_type(state, type_id, &mut CollectBoundLevels { levels }); + } +} + +impl TypeFold for CollectBoundLevels<'_> { + fn transform(&mut self, _state: &mut CheckState, id: TypeId, t: &Type) -> FoldAction { + match t { + Type::Variable(Variable::Bound(level, _)) => { + self.levels.insert(*level); + FoldAction::Replace(id) + } + _ => FoldAction::Continue, + } + } +} + +/// Collects all bound variables with their kinds from a type. +struct CollectBoundVariables<'a> { + variables: &'a mut FxHashMap, +} + +impl<'a> CollectBoundVariables<'a> { + fn on( + state: &mut CheckState, + type_id: TypeId, + variables: &'a mut FxHashMap, + ) { + fold_type(state, type_id, &mut CollectBoundVariables { variables }); + } +} + +impl TypeFold for CollectBoundVariables<'_> { + fn transform(&mut self, _state: &mut CheckState, id: TypeId, t: &Type) -> FoldAction { + match t { + Type::Variable(Variable::Bound(level, kind)) => { + self.variables.insert(*level, *kind); + FoldAction::Replace(id) + } + _ => FoldAction::Continue, + } + } +} diff --git a/compiler-core/checking/src/algorithm/derive/higher_kinded.rs b/compiler-core/checking/src/algorithm/derive/higher_kinded.rs index 7c09a2d4..d018a80a 100644 --- a/compiler-core/checking/src/algorithm/derive/higher_kinded.rs +++ b/compiler-core/checking/src/algorithm/derive/higher_kinded.rs @@ -77,17 +77,11 @@ where return false; }; - let Some(kind) = lookup_variable_kind(state, variable) else { - return false; + let kind = match variable { + Variable::Skolem(_, kind) => *kind, + Variable::Bound(_, kind) => *kind, + Variable::Free(_) => context.prim.unknown, }; Zonk::on(state, kind) == context.prim.type_to_type } - -fn lookup_variable_kind(state: &CheckState, variable: &Variable) -> Option { - match variable { - Variable::Skolem(_, kind) => Some(*kind), - Variable::Bound(level) => state.type_scope.kinds.get(*level).copied(), - Variable::Free(_) => None, - } -} diff --git a/compiler-core/checking/src/algorithm/fold.rs b/compiler-core/checking/src/algorithm/fold.rs index 1294d787..82230846 100644 --- a/compiler-core/checking/src/algorithm/fold.rs +++ b/compiler-core/checking/src/algorithm/fold.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use crate::algorithm::state::CheckState; -use crate::core::{ForallBinder, RowType, Type, TypeId}; +use crate::core::{ForallBinder, RowType, Type, TypeId, Variable}; /// Controls behavior during type folding. pub enum FoldAction { @@ -103,7 +103,17 @@ pub fn fold_type(state: &mut CheckState, id: TypeId, folder: &mut F state.storage.intern(Type::SynonymApplication(saturation, file_id, type_id, arguments)) } Type::Unification(_) => id, - Type::Variable(_) => id, + Type::Variable(variable) => match variable { + Variable::Bound(level, kind) => { + let kind = fold_type(state, kind, folder); + state.storage.intern(Type::Variable(Variable::Bound(level, kind))) + } + Variable::Skolem(level, kind) => { + let kind = fold_type(state, kind, folder); + state.storage.intern(Type::Variable(Variable::Skolem(level, kind))) + } + Variable::Free(_) => id, + }, Type::Unknown => id, } } diff --git a/compiler-core/checking/src/algorithm/inspect.rs b/compiler-core/checking/src/algorithm/inspect.rs index 94abcaee..995d4e76 100644 --- a/compiler-core/checking/src/algorithm/inspect.rs +++ b/compiler-core/checking/src/algorithm/inspect.rs @@ -90,7 +90,8 @@ where state.type_scope.kinds.insert(new_level, binder.kind); - let variable = state.storage.intern(Type::Variable(Variable::Bound(new_level))); + let variable = + state.storage.intern(Type::Variable(Variable::Bound(new_level, binder.kind))); let inner = substitute::SubstituteBound::on(state, old_level, variable, inner); variables.push(binder); @@ -142,7 +143,8 @@ where let level = state.type_scope.bound.bind(debruijn::Variable::Core); state.type_scope.kinds.insert(level, binder_kind); - let variable = state.storage.intern(Type::Variable(Variable::Bound(level))); + let variable = + state.storage.intern(Type::Variable(Variable::Bound(level, binder_kind))); current_id = substitute::SubstituteBound::on(state, binder_level, variable, inner); } diff --git a/compiler-core/checking/src/algorithm/kind.rs b/compiler-core/checking/src/algorithm/kind.rs index 5a8287e1..751f9ae4 100644 --- a/compiler-core/checking/src/algorithm/kind.rs +++ b/compiler-core/checking/src/algorithm/kind.rs @@ -258,14 +258,14 @@ fn infer_forall_variable( ) -> (TypeId, TypeId) { let level = state.type_scope.lookup_forall(forall).expect("invariant violated: TypeScope::bind_forall"); - let variable = Variable::Bound(level); - - let t = state.storage.intern(Type::Variable(variable)); let k = state .type_scope .lookup_forall_kind(forall) .expect("invariant violated: TypeScope::bind_forall"); + let variable = Variable::Bound(level, k); + let t = state.storage.intern(Type::Variable(variable)); + (t, k) } @@ -274,26 +274,26 @@ fn infer_implicit_variable( context: &CheckContext, implicit: &lowering::ImplicitTypeVariable, ) -> (TypeId, TypeId) { - let t = if implicit.binding { + let (t, k) = if implicit.binding { let kind = state.fresh_unification(context); let level = state.type_scope.bind_implicit(implicit.node, implicit.id, kind); - let variable = Variable::Bound(level); + let variable = Variable::Bound(level, kind); - state.storage.intern(Type::Variable(variable)) + (state.storage.intern(Type::Variable(variable)), kind) } else { let level = state .type_scope .lookup_implicit(implicit.node, implicit.id) .expect("invariant violated: TypeScope::bind_implicit"); - let variable = Variable::Bound(level); - state.storage.intern(Type::Variable(variable)) - }; + let kind = state + .type_scope + .lookup_implicit_kind(implicit.node, implicit.id) + .expect("invariant violated: TypeScope::bind_implicit"); - let k = state - .type_scope - .lookup_implicit_kind(implicit.node, implicit.id) - .expect("invariant violated: TypeScope::bind_implicit"); + let variable = Variable::Bound(level, kind); + (state.storage.intern(Type::Variable(variable)), kind) + }; (t, k) } @@ -508,9 +508,7 @@ where Type::Unification(unification_id) => state.unification.get(unification_id).kind, Type::Variable(ref variable) => match variable { - Variable::Bound(level) => { - state.type_scope.kinds.get(*level).copied().unwrap_or(unknown) - } + Variable::Bound(_, kind) => *kind, Variable::Skolem(_, kind) => *kind, Variable::Free(_) => unknown, }, diff --git a/compiler-core/checking/src/algorithm/quantify.rs b/compiler-core/checking/src/algorithm/quantify.rs index f56f8e9c..5d6127cf 100644 --- a/compiler-core/checking/src/algorithm/quantify.rs +++ b/compiler-core/checking/src/algorithm/quantify.rs @@ -14,7 +14,7 @@ use crate::algorithm::constraint::{self, ConstraintApplication}; use crate::algorithm::fold::Zonk; use crate::algorithm::state::{CheckContext, CheckState}; use crate::algorithm::substitute::{ShiftBound, SubstituteUnification, UniToLevel}; -use crate::core::{Class, ForallBinder, Instance, RowType, Type, TypeId, debruijn}; +use crate::core::{Class, ForallBinder, Instance, RowType, Type, TypeId, Variable, debruijn}; pub fn quantify(state: &mut CheckState, id: TypeId) -> Option<(TypeId, debruijn::Size)> { let graph = collect_unification(state, id); @@ -47,7 +47,7 @@ pub fn quantify(state: &mut CheckState, id: TypeId) -> Option<(TypeId, debruijn: let binder = ForallBinder { visible: false, name, level, kind }; quantified = state.storage.intern(Type::Forall(binder, quantified)); - substitutions.insert(id, level); + substitutions.insert(id, (level, kind)); } let quantified = SubstituteUnification::on(&substitutions, state, quantified); @@ -219,9 +219,11 @@ pub fn quantify_class(state: &mut CheckState, class: &mut Class) -> Option Opt let mut substitutions = UniToLevel::default(); for (index, &id) in unsolved.iter().rev().enumerate() { + let kind = state.unification.get(id).kind; + let kind = ShiftBound::on(state, kind, size.0); let index = debruijn::Index(index as u32); let level = index.to_level(size)?; - substitutions.insert(id, level); + substitutions.insert(id, (level, kind)); } - let kind_variables = substitutions.iter().map(|(&id, &level)| { - let kind = state.unification.get(id).kind; - (level, kind) - }); - + let kind_variables = substitutions.values().copied(); let kind_variables = kind_variables.sorted_by_key(|(level, _)| *level); let kind_variables = kind_variables.map(|(_, kind)| kind).collect_vec(); @@ -418,7 +418,12 @@ pub fn collect_unification_into(graph: &mut UniGraph, state: &mut CheckState, id let entry = state.unification.get(unification_id); aux(graph, state, entry.kind, Some(unification_id)); } - Type::Variable(_) => (), + Type::Variable(ref variable) => match variable { + Variable::Bound(_, kind) | Variable::Skolem(_, kind) => { + aux(graph, state, *kind, dependent); + } + Variable::Free(_) => {} + }, Type::Unknown => (), } } diff --git a/compiler-core/checking/src/algorithm/substitute.rs b/compiler-core/checking/src/algorithm/substitute.rs index fac69b7a..51954ca3 100644 --- a/compiler-core/checking/src/algorithm/substitute.rs +++ b/compiler-core/checking/src/algorithm/substitute.rs @@ -26,7 +26,7 @@ impl SubstituteBound { impl TypeFold for SubstituteBound { fn transform(&mut self, _state: &mut CheckState, _id: TypeId, t: &Type) -> FoldAction { - if let Type::Variable(Variable::Bound(level)) = t + if let Type::Variable(Variable::Bound(level, _)) = t && *level == self.target_level { return FoldAction::Replace(self.with_type); @@ -55,9 +55,9 @@ impl ShiftBound { impl TypeFold for ShiftBound { fn transform(&mut self, state: &mut CheckState, _id: TypeId, t: &Type) -> FoldAction { - if let Type::Variable(Variable::Bound(level)) = t { + if let Type::Variable(Variable::Bound(level, kind)) = t { let level = debruijn::Level(level.0 + self.offset); - FoldAction::Replace(state.storage.intern(Type::Variable(Variable::Bound(level)))) + FoldAction::Replace(state.storage.intern(Type::Variable(Variable::Bound(level, *kind)))) } else { FoldAction::Continue } @@ -68,7 +68,7 @@ impl TypeFold for ShiftBound { } } -pub type UniToLevel = FxHashMap; +pub type UniToLevel = FxHashMap; pub struct SubstituteUnification<'a> { substitutions: &'a UniToLevel, @@ -87,9 +87,9 @@ impl SubstituteUnification<'_> { impl TypeFold for SubstituteUnification<'_> { fn transform(&mut self, state: &mut CheckState, id: TypeId, t: &Type) -> FoldAction { if let Type::Unification(unification_id) = t { - if let Some(&level) = self.substitutions.get(unification_id) { + if let Some(&(level, kind)) = self.substitutions.get(unification_id) { return FoldAction::Replace( - state.storage.intern(Type::Variable(Variable::Bound(level))), + state.storage.intern(Type::Variable(Variable::Bound(level, kind))), ); } return FoldAction::Replace(id); @@ -119,7 +119,7 @@ impl SubstituteBindings<'_> { impl TypeFold for SubstituteBindings<'_> { fn transform(&mut self, _state: &mut CheckState, id: TypeId, t: &Type) -> FoldAction { match t { - Type::Variable(Variable::Bound(level)) => { + Type::Variable(Variable::Bound(level, _)) => { let id = self.bindings.get(level).copied().unwrap_or(id); FoldAction::Replace(id) } diff --git a/compiler-core/checking/src/algorithm/term.rs b/compiler-core/checking/src/algorithm/term.rs index ce4dc542..bee5fe78 100644 --- a/compiler-core/checking/src/algorithm/term.rs +++ b/compiler-core/checking/src/algorithm/term.rs @@ -5,7 +5,9 @@ use smol_str::SmolStr; use crate::ExternalQueries; use crate::algorithm::state::{CheckContext, CheckState}; -use crate::algorithm::{binder, inspect, kind, operator, substitute, toolkit, transfer, unification}; +use crate::algorithm::{ + binder, inspect, kind, operator, substitute, toolkit, transfer, unification, +}; use crate::core::{RowField, RowType, Type, TypeId}; use crate::error::{ErrorKind, ErrorStep}; diff --git a/compiler-core/checking/src/algorithm/transfer.rs b/compiler-core/checking/src/algorithm/transfer.rs index 7b9bcb4d..7be62ec8 100644 --- a/compiler-core/checking/src/algorithm/transfer.rs +++ b/compiler-core/checking/src/algorithm/transfer.rs @@ -26,7 +26,7 @@ use std::sync::Arc; use crate::algorithm::state::{CheckContext, CheckState}; -use crate::core::RowType; +use crate::core::{RowType, Variable}; use crate::{ExternalQueries, Type, TypeId}; /// Moves a type from local memory to global memory. @@ -148,20 +148,26 @@ fn traverse<'a, Q: ExternalQueries>(source: &mut TraversalSource<'a, Q>, id: Typ Type::Unification(_) => match source.mode { TraversalMode::FromGlobal => { - // unreachable!( - // "invariant violated: forbidden unification variable transfer from Localize" - // ); + // eprintln!("localize: unification variable ?{unification_id} escaped"); Type::Unknown } TraversalMode::FromLocal => { - // unreachable!( - // "invariant violated: forbidden unification variable transfer from Globalize" - // ); + // eprintln!("globalize: unification variable ?{unification_id} escaped"); Type::Unknown } }, - Type::Variable(variable) => Type::Variable(variable), + Type::Variable(variable) => match variable { + Variable::Skolem(level, kind) => { + let kind = traverse(source, kind); + Type::Variable(Variable::Skolem(level, kind)) + } + Variable::Bound(level, kind) => { + let kind = traverse(source, kind); + Type::Variable(Variable::Bound(level, kind)) + } + free @ Variable::Free(_) => Type::Variable(free), + }, Type::Unknown => Type::Unknown, }; diff --git a/compiler-core/checking/src/algorithm/type_item.rs b/compiler-core/checking/src/algorithm/type_item.rs index de37fe3f..202bd8fa 100644 --- a/compiler-core/checking/src/algorithm/type_item.rs +++ b/compiler-core/checking/src/algorithm/type_item.rs @@ -255,7 +255,7 @@ where let class_reference = { let reference_type = state.storage.intern(Type::Constructor(context.id, item_id)); type_variables.iter().cloned().fold(reference_type, |reference_type, binder| { - let variable = Variable::Bound(binder.level); + let variable = Variable::Bound(binder.level, binder.kind); let variable = state.storage.intern(Type::Variable(variable)); state.storage.intern(Type::Application(reference_type, variable)) }) @@ -492,7 +492,7 @@ where let reference_type = state.storage.intern(Type::Constructor(context.id, item_id)); let reference_type = kind_variables.iter().fold(reference_type, |reference, binder| { - let variable = Variable::Bound(binder.level); + let variable = Variable::Bound(binder.level, binder.kind); let variable = state.storage.intern(Type::Variable(variable)); state.storage.intern(Type::KindApplication(reference, variable)) }); @@ -510,7 +510,7 @@ where }); type_variables.iter().fold(reference_type, |reference, binder| { - let variable = Variable::Bound(binder.level); + let variable = Variable::Bound(binder.level, binder.kind); let variable = state.storage.intern(Type::Variable(variable)); state.storage.intern(Type::Application(reference, variable)) }) @@ -874,7 +874,7 @@ fn infer_roles( ) { let type_id = state.normalize_type(type_id); match state.storage[type_id].clone() { - Type::Variable(Variable::Bound(level)) => { + Type::Variable(Variable::Bound(level, _)) => { if let Some(index) = variables.iter().position(|v| v.level == level) { // The following cases infer to nominal roles: // @@ -897,7 +897,7 @@ fn infer_roles( Type::Application(function, argument) => { let function_id = state.normalize_type(function); let is_type_variable = - matches!(state.storage[function_id], Type::Variable(Variable::Bound(_))); + matches!(state.storage[function_id], Type::Variable(Variable::Bound(..))); aux(state, roles, variables, function, under_constraint, false); aux(state, roles, variables, argument, under_constraint, is_type_variable); @@ -948,12 +948,18 @@ fn infer_roles( } } + Type::Variable(ref variable) => match variable { + Variable::Bound(_, kind) | Variable::Skolem(_, kind) => { + aux(state, roles, variables, *kind, under_constraint, false); + } + Variable::Free(_) => {} + }, + Type::Constructor(_, _) | Type::Integer(_) | Type::Operator(_, _) | Type::String(_, _) | Type::Unification(_) - | Type::Variable(_) | Type::Unknown => (), } } diff --git a/compiler-core/checking/src/algorithm/unification.rs b/compiler-core/checking/src/algorithm/unification.rs index 77a65bd7..ff5c1cd4 100644 --- a/compiler-core/checking/src/algorithm/unification.rs +++ b/compiler-core/checking/src/algorithm/unification.rs @@ -300,13 +300,19 @@ pub fn promote_type( Type::Variable(ref variable) => { // A bound variable escapes if its level >= the unification variable's domain. // This means the variable was bound at or after the unification was created. - if let Variable::Bound(level) = variable { - let unification = state.unification.get(unification_id); - if level.0 >= unification.domain.0 { - return false; + match variable { + Variable::Bound(level, kind) => { + let unification = state.unification.get(unification_id); + if level.0 >= unification.domain.0 { + return false; + } + promote_type(state, occurs, codomain, unification_id, *kind) + } + Variable::Skolem(_, kind) => { + promote_type(state, occurs, codomain, unification_id, *kind) } + Variable::Free(_) => true, } - true } Type::Unknown => true, diff --git a/compiler-core/checking/src/algorithm/visit.rs b/compiler-core/checking/src/algorithm/visit.rs index 02b3fd9f..86ebd0fc 100644 --- a/compiler-core/checking/src/algorithm/visit.rs +++ b/compiler-core/checking/src/algorithm/visit.rs @@ -2,7 +2,7 @@ use files::FileId; use rustc_hash::FxHashSet; use crate::algorithm::state::CheckState; -use crate::core::{ForallBinder, RowType, Type, TypeId}; +use crate::core::{ForallBinder, RowType, Type, TypeId, Variable}; /// Controls behavior during type visiting. pub enum VisitAction { @@ -96,7 +96,12 @@ pub fn visit_type(state: &mut CheckState, id: TypeId, visitor: & } } Type::Unification(_) => {} - Type::Variable(_) => {} + Type::Variable(variable) => match variable { + Variable::Bound(_, kind) | Variable::Skolem(_, kind) => { + visit_type(state, kind, visitor); + } + Variable::Free(_) => {} + }, Type::Unknown => {} } } diff --git a/compiler-core/checking/src/core.rs b/compiler-core/checking/src/core.rs index 1253d783..2c52d099 100644 --- a/compiler-core/checking/src/core.rs +++ b/compiler-core/checking/src/core.rs @@ -20,7 +20,7 @@ pub struct ForallBinder { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Variable { Skolem(debruijn::Level, TypeId), - Bound(debruijn::Level), + Bound(debruijn::Level, TypeId), Free(SmolStr), } diff --git a/compiler-core/checking/src/core/pretty.rs b/compiler-core/checking/src/core/pretty.rs index c0dcec24..679d8a1f 100644 --- a/compiler-core/checking/src/core/pretty.rs +++ b/compiler-core/checking/src/core/pretty.rs @@ -466,22 +466,41 @@ where format_row(arena, source, context, &fields, tail) } - Type::Variable(ref variable) => render_variable(arena, variable, context), + Type::Variable(ref variable) => render_variable(arena, source, context, variable), Type::Unknown => arena.text("???"), } } -fn render_variable<'a>( +fn render_variable<'a, Q>( arena: &'a Arena<'a>, + source: &mut TraversalSource<'_, Q>, + context: &mut TraversalContext, variable: &Variable, - context: &TraversalContext, -) -> Doc<'a> { +) -> Doc<'a> +where + Q: ExternalQueries, +{ match variable { - Variable::Skolem(level, _) => arena.text(format!("~{}", level)), - Variable::Bound(level) => { + Variable::Skolem(level, kind) => { + let kind_doc = traverse_precedence(arena, source, context, Precedence::Top, *kind); + arena + .text("(") + .append(arena.text(format!("~{}", level))) + .append(arena.text(" :: ")) + .append(kind_doc) + .append(arena.text(")")) + } + Variable::Bound(level, kind) => { let name = context.names.get(&level.0).cloned(); - arena.text(name.unwrap_or_else(|| format!("{}", level))) + let name_doc = arena.text(name.unwrap_or_else(|| format!("{}", level))); + let kind_doc = traverse_precedence(arena, source, context, Precedence::Top, *kind); + arena + .text("(") + .append(name_doc) + .append(arena.text(" :: ")) + .append(kind_doc) + .append(arena.text(")")) } Variable::Free(name) => arena.text(format!("{}", name)), } diff --git a/compiler-core/lowering/src/algorithm.rs b/compiler-core/lowering/src/algorithm.rs index 2b1e36a4..780d2bd0 100644 --- a/compiler-core/lowering/src/algorithm.rs +++ b/compiler-core/lowering/src/algorithm.rs @@ -371,15 +371,14 @@ fn lower_term_item(state: &mut State, context: &Context, item_id: TermItemId, it state.resolve_type_reference(context, qualifier.as_deref(), &name) }); + state.push_implicit_scope(); let arguments = recover! { let head = cst.as_ref()?.instance_head()?; - state.push_implicit_scope(); - let arguments = head + + head .children() .map(|cst| recursive::lower_type(state, context, &cst)) - .collect(); - state.finish_implicit_scope(); - arguments + .collect() }; let constraints = recover! { @@ -389,6 +388,7 @@ fn lower_term_item(state: &mut State, context: &Context, item_id: TermItemId, it .map(|cst| recursive::lower_type(state, context, &cst)) .collect() }; + state.finish_implicit_scope(); let kind = TermItemIr::Derive { newtype, constraints, resolution, arguments }; state.info.term_item.insert(item_id, kind); @@ -417,15 +417,14 @@ fn lower_term_item(state: &mut State, context: &Context, item_id: TermItemId, it state.resolve_type_reference(context, qualifier.as_deref(), &name) }); + state.push_implicit_scope(); let arguments = recover! { let head = cst.as_ref()?.instance_head()?; - state.push_implicit_scope(); - let arguments = head + + head .children() .map(|cst| recursive::lower_type(state, context, &cst)) - .collect(); - state.finish_implicit_scope(); - arguments + .collect() }; let constraints = recover! { @@ -435,6 +434,7 @@ fn lower_term_item(state: &mut State, context: &Context, item_id: TermItemId, it .map(|cst| recursive::lower_type(state, context, &cst)) .collect() }; + state.finish_implicit_scope(); let members = recover! { let statements = cst.as_ref()?.instance_statements()?; diff --git a/tests-integration/fixtures/checking/001_proxy_checking/Main.snap b/tests-integration/fixtures/checking/001_proxy_checking/Main.snap index 3b8f7595..3c93902d 100644 --- a/tests-integration/fixtures/checking/001_proxy_checking/Main.snap +++ b/tests-integration/fixtures/checking/001_proxy_checking/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/002_proxy_inference/Main.snap b/tests-integration/fixtures/checking/002_proxy_inference/Main.snap index 22188897..8c23bb30 100644 --- a/tests-integration/fixtures/checking/002_proxy_inference/Main.snap +++ b/tests-integration/fixtures/checking/002_proxy_inference/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (t0 :: Type) (a :: t0). Proxy @t0 a +Proxy :: forall (t0 :: Type) (a :: (t0 :: Type)). Proxy @(t0 :: Type) (a :: (t0 :: Type)) Types -Proxy :: forall (t0 :: Type). t0 -> Type +Proxy :: forall (t0 :: Type). (t0 :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/003_data_recursive/Main.snap b/tests-integration/fixtures/checking/003_data_recursive/Main.snap index 4016bb24..cfbfec32 100644 --- a/tests-integration/fixtures/checking/003_data_recursive/Main.snap +++ b/tests-integration/fixtures/checking/003_data_recursive/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nil :: forall (a :: Type). List a -Cons :: forall (a :: Type). a -> List a -> List a +Nil :: forall (a :: Type). List (a :: Type) +Cons :: forall (a :: Type). (a :: Type) -> List (a :: Type) -> List (a :: Type) Types List :: Type -> Type diff --git a/tests-integration/fixtures/checking/004_data_mutual/Main.snap b/tests-integration/fixtures/checking/004_data_mutual/Main.snap index 0b0411fe..dcfcbb28 100644 --- a/tests-integration/fixtures/checking/004_data_mutual/Main.snap +++ b/tests-integration/fixtures/checking/004_data_mutual/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tree :: forall (a :: Type). a -> Forest a -> Tree a -Nil :: forall (a :: Type). Forest a -Cons :: forall (a :: Type). Tree a -> Forest a -> Forest a +Tree :: forall (a :: Type). (a :: Type) -> Forest (a :: Type) -> Tree (a :: Type) +Nil :: forall (a :: Type). Forest (a :: Type) +Cons :: forall (a :: Type). Tree (a :: Type) -> Forest (a :: Type) -> Forest (a :: Type) Types Tree :: Type -> Type diff --git a/tests-integration/fixtures/checking/005_newtype_recursive/Main.snap b/tests-integration/fixtures/checking/005_newtype_recursive/Main.snap index 518d0b78..d221bf6b 100644 --- a/tests-integration/fixtures/checking/005_newtype_recursive/Main.snap +++ b/tests-integration/fixtures/checking/005_newtype_recursive/Main.snap @@ -3,7 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -In :: forall (f :: Type -> Type). f (Mu f) -> Mu f +In :: + forall (f :: Type -> Type). (f :: Type -> Type) (Mu (f :: Type -> Type)) -> Mu (f :: Type -> Type) Types Mu :: (Type -> Type) -> Type diff --git a/tests-integration/fixtures/checking/006_type_synonym/Main.snap b/tests-integration/fixtures/checking/006_type_synonym/Main.snap index 3fa86715..47dc5a18 100644 --- a/tests-integration/fixtures/checking/006_type_synonym/Main.snap +++ b/tests-integration/fixtures/checking/006_type_synonym/Main.snap @@ -8,10 +8,13 @@ Types Tuple :: Type -> Type -> Type AliasType :: Type AliasTypeType :: Type -> Type -InferApply :: forall (t4 :: Type) (t9 :: Type). (t9 -> t4) -> t9 -> t4 +InferApply :: + forall (t4 :: Type) (t9 :: Type). ((t9 :: Type) -> (t4 :: Type)) -> (t9 :: Type) -> (t4 :: Type) InferTuple :: Type -> Type -> Type -CheckApply :: forall (x :: Type) (y :: Type). (x -> y) -> x -> y -CheckApplyElab :: forall (x :: Type) (y :: Type). (x -> y) -> x -> y +CheckApply :: + forall (x :: Type) (y :: Type). ((x :: Type) -> (y :: Type)) -> (x :: Type) -> (y :: Type) +CheckApplyElab :: + forall (x :: Type) (y :: Type). ((x :: Type) -> (y :: Type)) -> (x :: Type) -> (y :: Type) Synonyms AliasType = Int @@ -24,22 +27,25 @@ AliasTypeType = Array Kind = :0 Type = :0 -InferApply = forall (t4 :: Type) (t9 :: Type) (f :: t9 -> t4) (a :: t9). f a +InferApply = forall (t4 :: Type) (t9 :: Type) (f :: (t9 :: Type) -> (t4 :: Type)) (a :: (t9 :: Type)). + (f :: (t9 :: Type) -> (t4 :: Type)) (a :: (t9 :: Type)) Quantified = :2 Kind = :0 Type = :2 -InferTuple = forall (x :: Type) (y :: Type). Tuple x y +InferTuple = forall (x :: Type) (y :: Type). Tuple (x :: Type) (y :: Type) Quantified = :0 Kind = :0 Type = :2 -CheckApply = forall (x :: Type) (y :: Type) (f :: x -> y) (a :: x). f a +CheckApply = forall (x :: Type) (y :: Type) (f :: (x :: Type) -> (y :: Type)) (a :: (x :: Type)). + (f :: (x :: Type) -> (y :: Type)) (a :: (x :: Type)) Quantified = :0 Kind = :2 Type = :2 -CheckApplyElab = forall (x :: Type) (y :: Type) (f :: x -> y) (a :: x). f a +CheckApplyElab = forall (x :: Type) (y :: Type) (f :: (x :: Type) -> (y :: Type)) (a :: (x :: Type)). + (f :: (x :: Type) -> (y :: Type)) (a :: (x :: Type)) Quantified = :0 Kind = :2 Type = :2 diff --git a/tests-integration/fixtures/checking/007_foreign_poly/Main.snap b/tests-integration/fixtures/checking/007_foreign_poly/Main.snap index f8833b48..776791fd 100644 --- a/tests-integration/fixtures/checking/007_foreign_poly/Main.snap +++ b/tests-integration/fixtures/checking/007_foreign_poly/Main.snap @@ -5,11 +5,12 @@ expression: report Terms Types -TuplePoly :: forall (a :: Type) (b :: Type). a -> b -> Type -InferTuplePoly :: forall (t7 :: Type) (t8 :: Type). t7 -> t8 -> Type +TuplePoly :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Type +InferTuplePoly :: forall (t7 :: Type) (t8 :: Type). (t7 :: Type) -> (t8 :: Type) -> Type Synonyms -InferTuplePoly = forall (t7 :: Type) (t8 :: Type) (x :: t7) (y :: t8). TuplePoly @t7 @t8 x y +InferTuplePoly = forall (t7 :: Type) (t8 :: Type) (x :: (t7 :: Type)) (y :: (t8 :: Type)). + TuplePoly @(t7 :: Type) @(t8 :: Type) (x :: (t7 :: Type)) (y :: (t8 :: Type)) Quantified = :2 Kind = :0 Type = :2 diff --git a/tests-integration/fixtures/checking/009_expand_identity_synonym/Main.snap b/tests-integration/fixtures/checking/009_expand_identity_synonym/Main.snap index 6117a786..59e04107 100644 --- a/tests-integration/fixtures/checking/009_expand_identity_synonym/Main.snap +++ b/tests-integration/fixtures/checking/009_expand_identity_synonym/Main.snap @@ -5,13 +5,13 @@ expression: report Terms Types -Identity :: forall (t0 :: Type). t0 -> t0 +Identity :: forall (t0 :: Type). (t0 :: Type) -> (t0 :: Type) Digit :: Int Test1 :: Type Test2 :: Int Synonyms -Identity = forall (t0 :: Type) (a :: t0). a +Identity = forall (t0 :: Type) (a :: (t0 :: Type)). (a :: (t0 :: Type)) Quantified = :1 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/010_class_basic/Main.snap b/tests-integration/fixtures/checking/010_class_basic/Main.snap index 92cd9023..108405ff 100644 --- a/tests-integration/fixtures/checking/010_class_basic/Main.snap +++ b/tests-integration/fixtures/checking/010_class_basic/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String Types Show :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/011_class_functor/Main.snap b/tests-integration/fixtures/checking/011_class_functor/Main.snap index 5c055dd4..343f855f 100644 --- a/tests-integration/fixtures/checking/011_class_functor/Main.snap +++ b/tests-integration/fixtures/checking/011_class_functor/Main.snap @@ -3,7 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -map :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Functor f => (a -> b) -> f a -> f b +map :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Functor (f :: Type -> Type) => + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) Types Functor :: (Type -> Type) -> Constraint diff --git a/tests-integration/fixtures/checking/012_class_monad_state/Main.snap b/tests-integration/fixtures/checking/012_class_monad_state/Main.snap index 314a03e9..896f426f 100644 --- a/tests-integration/fixtures/checking/012_class_monad_state/Main.snap +++ b/tests-integration/fixtures/checking/012_class_monad_state/Main.snap @@ -3,9 +3,16 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -return :: forall (m :: Type -> Type) (a :: Type). Monad m => a -> m a -get :: forall (s :: Type) (m :: Type -> Type). MonadState s m => m s -modify :: forall (s :: Type) (m :: Type -> Type). MonadState s m => (s -> s) -> m s +return :: + forall (m :: Type -> Type) (a :: Type). + Monad (m :: Type -> Type) => (a :: Type) -> (m :: Type -> Type) (a :: Type) +get :: + forall (s :: Type) (m :: Type -> Type). + MonadState (s :: Type) (m :: Type -> Type) => (m :: Type -> Type) (s :: Type) +modify :: + forall (s :: Type) (m :: Type -> Type). + MonadState (s :: Type) (m :: Type -> Type) => + ((s :: Type) -> (s :: Type)) -> (m :: Type -> Type) (s :: Type) Types Monad :: (Type -> Type) -> Constraint @@ -13,4 +20,4 @@ MonadState :: Type -> (Type -> Type) -> Constraint Classes class Monad (&0 :: Type -> Type) -class Monad &1 <= MonadState (&0 :: Type) (&1 :: Type -> Type) +class Monad (&1 :: Type -> Type) <= MonadState (&0 :: Type) (&1 :: Type -> Type) diff --git a/tests-integration/fixtures/checking/013_class_phantom/Main.snap b/tests-integration/fixtures/checking/013_class_phantom/Main.snap index 1614b466..01403597 100644 --- a/tests-integration/fixtures/checking/013_class_phantom/Main.snap +++ b/tests-integration/fixtures/checking/013_class_phantom/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -value :: forall (t0 :: Type) (a :: t0). Phantom a => Int +value :: forall (t0 :: Type) (a :: (t0 :: Type)). Phantom (a :: (t0 :: Type)) => Int Types -Phantom :: forall (t0 :: Type). t0 -> Constraint +Phantom :: forall (t0 :: Type). (t0 :: Type) -> Constraint Classes -class Phantom (&1 :: &0) +class Phantom (&1 :: (&0 :: Type)) diff --git a/tests-integration/fixtures/checking/014_class_with_signature/Main.snap b/tests-integration/fixtures/checking/014_class_with_signature/Main.snap index 5c055dd4..343f855f 100644 --- a/tests-integration/fixtures/checking/014_class_with_signature/Main.snap +++ b/tests-integration/fixtures/checking/014_class_with_signature/Main.snap @@ -3,7 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -map :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Functor f => (a -> b) -> f a -> f b +map :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Functor (f :: Type -> Type) => + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) Types Functor :: (Type -> Type) -> Constraint diff --git a/tests-integration/fixtures/checking/015_class_superclass/Main.snap b/tests-integration/fixtures/checking/015_class_superclass/Main.snap index 37d521b1..4df74fab 100644 --- a/tests-integration/fixtures/checking/015_class_superclass/Main.snap +++ b/tests-integration/fixtures/checking/015_class_superclass/Main.snap @@ -3,8 +3,15 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -map :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Functor f => (a -> b) -> f a -> f b -pure :: forall (f :: Type -> Type) (a :: Type). Applicative f => a -> f a +map :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Functor (f :: Type -> Type) => + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +pure :: + forall (f :: Type -> Type) (a :: Type). + Applicative (f :: Type -> Type) => (a :: Type) -> (f :: Type -> Type) (a :: Type) Types Functor :: (Type -> Type) -> Constraint @@ -12,4 +19,4 @@ Applicative :: (Type -> Type) -> Constraint Classes class Functor (&0 :: Type -> Type) -class Functor &0 <= Applicative (&0 :: Type -> Type) +class Functor (&0 :: Type -> Type) <= Applicative (&0 :: Type -> Type) diff --git a/tests-integration/fixtures/checking/016_type_integer/Main.snap b/tests-integration/fixtures/checking/016_type_integer/Main.snap index 62506109..04ad0a44 100644 --- a/tests-integration/fixtures/checking/016_type_integer/Main.snap +++ b/tests-integration/fixtures/checking/016_type_integer/Main.snap @@ -5,7 +5,7 @@ expression: report Terms Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Positive :: Type Negative :: Type Underscore :: Type diff --git a/tests-integration/fixtures/checking/017_type_string/Main.snap b/tests-integration/fixtures/checking/017_type_string/Main.snap index bb54d20d..4674a3a0 100644 --- a/tests-integration/fixtures/checking/017_type_string/Main.snap +++ b/tests-integration/fixtures/checking/017_type_string/Main.snap @@ -5,7 +5,7 @@ expression: report Terms Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Simple :: Type WithEscape :: Type WithBackslash :: Type diff --git a/tests-integration/fixtures/checking/018_type_operator_valid/Main.snap b/tests-integration/fixtures/checking/018_type_operator_valid/Main.snap index 27618457..0d83f4ff 100644 --- a/tests-integration/fixtures/checking/018_type_operator_valid/Main.snap +++ b/tests-integration/fixtures/checking/018_type_operator_valid/Main.snap @@ -5,11 +5,11 @@ expression: report Terms Types -Add :: forall (t0 :: Type) (t2 :: Type). t0 -> t2 -> t0 -+ :: forall (t0 :: Type) (t2 :: Type). t0 -> t2 -> t0 +Add :: forall (t0 :: Type) (t2 :: Type). (t0 :: Type) -> (t2 :: Type) -> (t0 :: Type) ++ :: forall (t0 :: Type) (t2 :: Type). (t0 :: Type) -> (t2 :: Type) -> (t0 :: Type) Synonyms -Add = forall (t0 :: Type) (t2 :: Type) (a :: t0) (b :: t2). a +Add = forall (t0 :: Type) (t2 :: Type) (a :: (t0 :: Type)) (b :: (t2 :: Type)). (a :: (t0 :: Type)) Quantified = :2 Kind = :0 Type = :2 diff --git a/tests-integration/fixtures/checking/019_type_operator_chain/Main.snap b/tests-integration/fixtures/checking/019_type_operator_chain/Main.snap index 855e1c65..faec8d5e 100644 --- a/tests-integration/fixtures/checking/019_type_operator_chain/Main.snap +++ b/tests-integration/fixtures/checking/019_type_operator_chain/Main.snap @@ -11,17 +11,17 @@ Chain :: Type -> Type -> Type -> Type ChainParen :: Type -> Type -> Type -> Type Synonyms -Add = forall (a :: Type) (b :: Type). a +Add = forall (a :: Type) (b :: Type). (a :: Type) Quantified = :0 Kind = :0 Type = :2 -Chain = forall (a :: Type) (b :: Type) (c :: Type). a + b + c +Chain = forall (a :: Type) (b :: Type) (c :: Type). (a :: Type) + (b :: Type) + (c :: Type) Quantified = :0 Kind = :0 Type = :3 -ChainParen = forall (a :: Type) (b :: Type) (c :: Type). a + b + c +ChainParen = forall (a :: Type) (b :: Type) (c :: Type). (a :: Type) + (b :: Type) + (c :: Type) Quantified = :0 Kind = :0 Type = :3 diff --git a/tests-integration/fixtures/checking/020_type_operator_chain_mixed/Main.snap b/tests-integration/fixtures/checking/020_type_operator_chain_mixed/Main.snap index c0080a82..5836f761 100644 --- a/tests-integration/fixtures/checking/020_type_operator_chain_mixed/Main.snap +++ b/tests-integration/fixtures/checking/020_type_operator_chain_mixed/Main.snap @@ -16,32 +16,32 @@ AddR :: Type -> Type -> Type AssocRight :: Type -> Type -> Type -> Type Synonyms -Add = forall (a :: Type) (b :: Type). a +Add = forall (a :: Type) (b :: Type). (a :: Type) Quantified = :0 Kind = :0 Type = :2 -Mul = forall (a :: Type) (b :: Type). b +Mul = forall (a :: Type) (b :: Type). (b :: Type) Quantified = :0 Kind = :0 Type = :2 -Mixed = forall (a :: Type) (b :: Type) (c :: Type). a + b * c +Mixed = forall (a :: Type) (b :: Type) (c :: Type). (a :: Type) + (b :: Type) * (c :: Type) Quantified = :0 Kind = :0 Type = :3 -AssocLeft = forall (a :: Type) (b :: Type) (c :: Type). a + b + c +AssocLeft = forall (a :: Type) (b :: Type) (c :: Type). (a :: Type) + (b :: Type) + (c :: Type) Quantified = :0 Kind = :0 Type = :3 -AddR = forall (a :: Type) (b :: Type). a +AddR = forall (a :: Type) (b :: Type). (a :: Type) Quantified = :0 Kind = :0 Type = :2 -AssocRight = forall (a :: Type) (b :: Type) (c :: Type). a -+- b -+- c +AssocRight = forall (a :: Type) (b :: Type) (c :: Type). (a :: Type) -+- (b :: Type) -+- (c :: Type) Quantified = :0 Kind = :0 Type = :3 diff --git a/tests-integration/fixtures/checking/021_type_operator_chain_polykinded/Main.snap b/tests-integration/fixtures/checking/021_type_operator_chain_polykinded/Main.snap index 2886346f..542bc1d3 100644 --- a/tests-integration/fixtures/checking/021_type_operator_chain_polykinded/Main.snap +++ b/tests-integration/fixtures/checking/021_type_operator_chain_polykinded/Main.snap @@ -5,23 +5,25 @@ expression: report Terms Types -Add :: forall (k :: Type). k -> k -> k -+ :: forall (k :: Type). k -> k -> k -Chain :: forall (k :: Type). k -> k -> k -> k -ChainParen :: forall (k :: Type). k -> k -> k -> k +Add :: forall (k :: Type). (k :: Type) -> (k :: Type) -> (k :: Type) ++ :: forall (k :: Type). (k :: Type) -> (k :: Type) -> (k :: Type) +Chain :: forall (k :: Type). (k :: Type) -> (k :: Type) -> (k :: Type) -> (k :: Type) +ChainParen :: forall (k :: Type). (k :: Type) -> (k :: Type) -> (k :: Type) -> (k :: Type) Synonyms -Add = forall (k :: Type) (a :: k) (b :: k). a +Add = forall (k :: Type) (a :: (k :: Type)) (b :: (k :: Type)). (a :: (k :: Type)) Quantified = :0 Kind = :1 Type = :2 -Chain = forall (k :: Type) (a :: k) (b :: k) (c :: k). a + b + c +Chain = forall (k :: Type) (a :: (k :: Type)) (b :: (k :: Type)) (c :: (k :: Type)). + (a :: (k :: Type)) + (b :: (k :: Type)) + (c :: (k :: Type)) Quantified = :0 Kind = :1 Type = :3 -ChainParen = forall (k :: Type) (a :: k) (b :: k) (c :: k). a + b + c +ChainParen = forall (k :: Type) (a :: (k :: Type)) (b :: (k :: Type)) (c :: (k :: Type)). + (a :: (k :: Type)) + (b :: (k :: Type)) + (c :: (k :: Type)) Quantified = :0 Kind = :1 Type = :3 diff --git a/tests-integration/fixtures/checking/023_row_polymorphic/Main.snap b/tests-integration/fixtures/checking/023_row_polymorphic/Main.snap index 1c2cc58f..1d547576 100644 --- a/tests-integration/fixtures/checking/023_row_polymorphic/Main.snap +++ b/tests-integration/fixtures/checking/023_row_polymorphic/Main.snap @@ -9,12 +9,12 @@ HasName :: Row Type -> Type HasNameRow :: Row Type -> Row Type Synonyms -HasName = forall (r :: Row Type). { name :: String | r } +HasName = forall (r :: Row Type). { name :: String | (r :: Row Type) } Quantified = :0 Kind = :0 Type = :1 -HasNameRow = forall (r :: Row Type). ( name :: String | r ) +HasNameRow = forall (r :: Row Type). ( name :: String | (r :: Row Type) ) Quantified = :0 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/026_row_empty/Main.snap b/tests-integration/fixtures/checking/026_row_empty/Main.snap index 86021ade..b2b8902d 100644 --- a/tests-integration/fixtures/checking/026_row_empty/Main.snap +++ b/tests-integration/fixtures/checking/026_row_empty/Main.snap @@ -5,9 +5,9 @@ expression: report Terms Types -EmptyRow :: forall (t1 :: Type). Row t1 +EmptyRow :: forall (t1 :: Type). Row (t1 :: Type) EmptyRecord :: Type -TailOnly :: forall (t7 :: Type). Row t7 -> Row t7 +TailOnly :: forall (t7 :: Type). Row (t7 :: Type) -> Row (t7 :: Type) TailOnlyRecord :: Row Type -> Type Synonyms @@ -21,12 +21,12 @@ EmptyRecord = {} Kind = :0 Type = :0 -TailOnly = forall (t7 :: Type) (r :: Row t7). ( | r ) +TailOnly = forall (t7 :: Type) (r :: Row (t7 :: Type)). ( | (r :: Row (t7 :: Type)) ) Quantified = :1 Kind = :0 Type = :1 -TailOnlyRecord = forall (r :: Row Type). { | r } +TailOnlyRecord = forall (r :: Row Type). { | (r :: Row Type) } Quantified = :0 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/027_type_constrained/Main.snap b/tests-integration/fixtures/checking/027_type_constrained/Main.snap index 1ba397fd..0354e07f 100644 --- a/tests-integration/fixtures/checking/027_type_constrained/Main.snap +++ b/tests-integration/fixtures/checking/027_type_constrained/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String Types Show :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/028_partial_synonym_lazy/Main.snap b/tests-integration/fixtures/checking/028_partial_synonym_lazy/Main.snap index 4c7c5073..c20f964a 100644 --- a/tests-integration/fixtures/checking/028_partial_synonym_lazy/Main.snap +++ b/tests-integration/fixtures/checking/028_partial_synonym_lazy/Main.snap @@ -5,17 +5,19 @@ expression: report Terms Types -RowApply :: forall (k :: Type). (Row k -> Row k) -> Row k -> Row k +RowApply :: + forall (k :: Type). (Row (k :: Type) -> Row (k :: Type)) -> Row (k :: Type) -> Row (k :: Type) ExampleRow :: Row Type -> Row Type F :: Row Type Synonyms -RowApply = forall (k :: Type) (f :: Row k -> Row k) (a :: Row k). f a +RowApply = forall (k :: Type) (f :: Row (k :: Type) -> Row (k :: Type)) (a :: Row (k :: Type)). + (f :: Row (k :: Type) -> Row (k :: Type)) (a :: Row (k :: Type)) Quantified = :0 Kind = :1 Type = :2 -ExampleRow = forall (r :: Row Type). ( a :: Int | r ) +ExampleRow = forall (r :: Row Type). ( a :: Int | (r :: Row Type) ) Quantified = :0 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/029_partial_synonym_transformers/Main.snap b/tests-integration/fixtures/checking/029_partial_synonym_transformers/Main.snap index 6d3df352..4f1f7800 100644 --- a/tests-integration/fixtures/checking/029_partial_synonym_transformers/Main.snap +++ b/tests-integration/fixtures/checking/029_partial_synonym_transformers/Main.snap @@ -3,10 +3,16 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a -ReaderT :: forall (r :: Type) (m :: Type -> Type) (a :: Type). (r -> m a) -> ReaderT r m a -StateT :: forall (s :: Type) (m :: Type -> Type) (a :: Type). (s -> m (Tuple a s)) -> StateT s m a -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) +ReaderT :: + forall (r :: Type) (m :: Type -> Type) (a :: Type). + ((r :: Type) -> (m :: Type -> Type) (a :: Type)) -> + ReaderT (r :: Type) (m :: Type -> Type) (a :: Type) +StateT :: + forall (s :: Type) (m :: Type -> Type) (a :: Type). + ((s :: Type) -> (m :: Type -> Type) (Tuple (a :: Type) (s :: Type))) -> + StateT (s :: Type) (m :: Type -> Type) (a :: Type) +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) Types Identity :: Type -> Type @@ -15,23 +21,24 @@ StateT :: Type -> (Type -> Type) -> Type -> Type Tuple :: Type -> Type -> Type Reader :: Type -> Type -> Type State :: Type -> Type -> Type -Apply :: forall (k :: Type) (l :: Type). (k -> l) -> k -> l +Apply :: forall (k :: Type) (l :: Type). ((k :: Type) -> (l :: Type)) -> (k :: Type) -> (l :: Type) ReaderInt :: Type StateString :: Type NestedReader :: Type Synonyms -Reader = forall (r :: Type). ReaderT r Identity +Reader = forall (r :: Type). ReaderT (r :: Type) Identity Quantified = :0 Kind = :0 Type = :1 -State = forall (s :: Type). StateT s Identity +State = forall (s :: Type). StateT (s :: Type) Identity Quantified = :0 Kind = :0 Type = :1 -Apply = forall (k :: Type) (l :: Type) (f :: k -> l) (a :: k). f a +Apply = forall (k :: Type) (l :: Type) (f :: (k :: Type) -> (l :: Type)) (a :: (k :: Type)). + (f :: (k :: Type) -> (l :: Type)) (a :: (k :: Type)) Quantified = :0 Kind = :2 Type = :2 diff --git a/tests-integration/fixtures/checking/030_partial_synonym_nested/Main.snap b/tests-integration/fixtures/checking/030_partial_synonym_nested/Main.snap index ff571779..08e11b3a 100644 --- a/tests-integration/fixtures/checking/030_partial_synonym_nested/Main.snap +++ b/tests-integration/fixtures/checking/030_partial_synonym_nested/Main.snap @@ -20,32 +20,34 @@ Compose :: (Type -> Type) -> (Type -> Type) -> Type -> Type Composed :: Type Synonyms -Apply1 = forall (f :: Type -> Type) (a :: Type). f a +Apply1 = forall (f :: Type -> Type) (a :: Type). (f :: Type -> Type) (a :: Type) Quantified = :0 Kind = :0 Type = :2 -Apply2 = forall (f :: Type -> Type -> Type) (a :: Type) (b :: Type). f a b +Apply2 = forall (f :: Type -> Type -> Type) (a :: Type) (b :: Type). + (f :: Type -> Type -> Type) (a :: Type) (b :: Type) Quantified = :0 Kind = :0 Type = :3 -Const = forall (a :: Type) (b :: Type). a +Const = forall (a :: Type) (b :: Type). (a :: Type) Quantified = :0 Kind = :0 Type = :2 -Flip = forall (f :: Type -> Type -> Type) (a :: Type) (b :: Type). f b a +Flip = forall (f :: Type -> Type -> Type) (a :: Type) (b :: Type). + (f :: Type -> Type -> Type) (b :: Type) (a :: Type) Quantified = :0 Kind = :0 Type = :3 -Wrapper = forall (a :: Type). a +Wrapper = forall (a :: Type). (a :: Type) Quantified = :0 Kind = :0 Type = :1 -Pair = forall (a :: Type) (b :: Type). a +Pair = forall (a :: Type) (b :: Type). (a :: Type) Quantified = :0 Kind = :0 Type = :2 @@ -65,7 +67,8 @@ Deep3 = Apply2 (Flip Pair) Int String Kind = :0 Type = :0 -Apply3 = forall (f :: (Type -> Type) -> Type -> Type) (g :: Type -> Type) (a :: Type). f g a +Apply3 = forall (f :: (Type -> Type) -> Type -> Type) (g :: Type -> Type) (a :: Type). + (f :: (Type -> Type) -> Type -> Type) (g :: Type -> Type) (a :: Type) Quantified = :0 Kind = :0 Type = :3 @@ -75,7 +78,8 @@ Deep4 = Apply3 Apply1 Wrapper Int Kind = :0 Type = :0 -Compose = forall (f :: Type -> Type) (g :: Type -> Type) (a :: Type). f (g a) +Compose = forall (f :: Type -> Type) (g :: Type -> Type) (a :: Type). + (f :: Type -> Type) ((g :: Type -> Type) (a :: Type)) Quantified = :0 Kind = :0 Type = :3 diff --git a/tests-integration/fixtures/checking/031_partial_synonym_polykind/Main.snap b/tests-integration/fixtures/checking/031_partial_synonym_polykind/Main.snap index 12517656..412afb5a 100644 --- a/tests-integration/fixtures/checking/031_partial_synonym_polykind/Main.snap +++ b/tests-integration/fixtures/checking/031_partial_synonym_polykind/Main.snap @@ -5,36 +5,39 @@ expression: report Terms Types -PolyApply :: forall (k :: Type). (k -> Type) -> k -> Type -RowApply :: forall (k :: Type). (Row k -> Row k) -> Row k -> Row k +PolyApply :: forall (k :: Type). ((k :: Type) -> Type) -> (k :: Type) -> Type +RowApply :: + forall (k :: Type). (Row (k :: Type) -> Row (k :: Type)) -> Row (k :: Type) -> Row (k :: Type) AddField :: Row Type -> Row Type AddAnother :: Row Type -> Row Type Applied1 :: Row Type Applied2 :: Row Type ComposeRow :: (Row Type -> Row Type) -> (Row Type -> Row Type) -> Row Type -> Row Type Combined :: Row Type -NaturalTransformation :: forall (k :: Type). (k -> Type) -> (k -> Type) -> Type -Endo :: forall (k :: Type). (k -> k -> Type) -> k -> Type +NaturalTransformation :: forall (k :: Type). ((k :: Type) -> Type) -> ((k :: Type) -> Type) -> Type +Endo :: forall (k :: Type). ((k :: Type) -> (k :: Type) -> Type) -> (k :: Type) -> Type EndoFn :: Type -> Type Function :: Type -> Type -> Type Synonyms -PolyApply = forall (k :: Type) (f :: k -> Type) (a :: k). f a +PolyApply = forall (k :: Type) (f :: (k :: Type) -> Type) (a :: (k :: Type)). + (f :: (k :: Type) -> Type) (a :: (k :: Type)) Quantified = :0 Kind = :1 Type = :2 -RowApply = forall (k :: Type) (f :: Row k -> Row k) (r :: Row k). f r +RowApply = forall (k :: Type) (f :: Row (k :: Type) -> Row (k :: Type)) (r :: Row (k :: Type)). + (f :: Row (k :: Type) -> Row (k :: Type)) (r :: Row (k :: Type)) Quantified = :0 Kind = :1 Type = :2 -AddField = forall (r :: Row Type). ( field :: String | r ) +AddField = forall (r :: Row Type). ( field :: String | (r :: Row Type) ) Quantified = :0 Kind = :0 Type = :1 -AddAnother = forall (r :: Row Type). ( another :: Int | r ) +AddAnother = forall (r :: Row Type). ( another :: Int | (r :: Row Type) ) Quantified = :0 Kind = :0 Type = :1 @@ -49,7 +52,8 @@ Applied2 = RowApply AddAnother () Kind = :0 Type = :0 -ComposeRow = forall (f :: Row Type -> Row Type) (g :: Row Type -> Row Type) (r :: Row Type). f (g r) +ComposeRow = forall (f :: Row Type -> Row Type) (g :: Row Type -> Row Type) (r :: Row Type). + (f :: Row Type -> Row Type) ((g :: Row Type -> Row Type) (r :: Row Type)) Quantified = :0 Kind = :0 Type = :3 @@ -59,17 +63,19 @@ Combined = ComposeRow AddField AddAnother () Kind = :0 Type = :0 -NaturalTransformation = forall (k :: Type) (f :: k -> Type) (g :: k -> Type) (a :: k). f a -> g a +NaturalTransformation = forall (k :: Type) (f :: (k :: Type) -> Type) (g :: (k :: Type) -> Type) (a :: (k :: Type)). + (f :: (k :: Type) -> Type) (a :: (k :: Type)) -> (g :: (k :: Type) -> Type) (a :: (k :: Type)) Quantified = :0 Kind = :1 Type = :2 -Endo = forall (k :: Type) (c :: k -> k -> Type) (a :: k). c a a +Endo = forall (k :: Type) (c :: (k :: Type) -> (k :: Type) -> Type) (a :: (k :: Type)). + (c :: (k :: Type) -> (k :: Type) -> Type) (a :: (k :: Type)) (a :: (k :: Type)) Quantified = :0 Kind = :1 Type = :2 -EndoFn = forall (a :: Type). Endo Function a +EndoFn = forall (a :: Type). Endo Function (a :: Type) Quantified = :0 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/032_recursive_synonym_expansion/Main.snap b/tests-integration/fixtures/checking/032_recursive_synonym_expansion/Main.snap index 202c8d28..91ec8369 100644 --- a/tests-integration/fixtures/checking/032_recursive_synonym_expansion/Main.snap +++ b/tests-integration/fixtures/checking/032_recursive_synonym_expansion/Main.snap @@ -9,9 +9,9 @@ testH :: H -> H testValid :: Int -> Int Types -F :: forall (t3 :: Type). t3 -G :: forall (t3 :: Type). t3 -H :: forall (t5 :: Type). t5 +F :: forall (t3 :: Type). (t3 :: Type) +G :: forall (t3 :: Type). (t3 :: Type) +H :: forall (t5 :: Type). (t5 :: Type) Valid :: Type Synonyms diff --git a/tests-integration/fixtures/checking/033_value_recursive_signature/Main.snap b/tests-integration/fixtures/checking/033_value_recursive_signature/Main.snap index 69e93403..c6c7ff35 100644 --- a/tests-integration/fixtures/checking/033_value_recursive_signature/Main.snap +++ b/tests-integration/fixtures/checking/033_value_recursive_signature/Main.snap @@ -3,6 +3,6 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -loop :: forall (a :: Type). a -> a +loop :: forall (a :: Type). (a :: Type) -> (a :: Type) Types diff --git a/tests-integration/fixtures/checking/034_value_recursive_infer/Main.snap b/tests-integration/fixtures/checking/034_value_recursive_infer/Main.snap index 64f45d65..f3b7da13 100644 --- a/tests-integration/fixtures/checking/034_value_recursive_infer/Main.snap +++ b/tests-integration/fixtures/checking/034_value_recursive_infer/Main.snap @@ -3,6 +3,6 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -loop :: forall (t1 :: Type) (t2 :: Type). t1 -> t2 +loop :: forall (t1 :: Type) (t2 :: Type). (t1 :: Type) -> (t2 :: Type) Types diff --git a/tests-integration/fixtures/checking/035_value_mutual_both_signature/Main.snap b/tests-integration/fixtures/checking/035_value_mutual_both_signature/Main.snap index 04c0089e..b5619472 100644 --- a/tests-integration/fixtures/checking/035_value_mutual_both_signature/Main.snap +++ b/tests-integration/fixtures/checking/035_value_mutual_both_signature/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -f :: forall (a :: Type). a -> a -g :: forall (a :: Type). a -> a +f :: forall (a :: Type). (a :: Type) -> (a :: Type) +g :: forall (a :: Type). (a :: Type) -> (a :: Type) Types diff --git a/tests-integration/fixtures/checking/036_value_mutual_one_signature/Main.snap b/tests-integration/fixtures/checking/036_value_mutual_one_signature/Main.snap index c3efabad..f411f707 100644 --- a/tests-integration/fixtures/checking/036_value_mutual_one_signature/Main.snap +++ b/tests-integration/fixtures/checking/036_value_mutual_one_signature/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -g :: forall (t3 :: Type). t3 -> t3 -f :: forall (a :: Type). a -> a +g :: forall (t3 :: Type). (t3 :: Type) -> (t3 :: Type) +f :: forall (a :: Type). (a :: Type) -> (a :: Type) Types diff --git a/tests-integration/fixtures/checking/037_value_mutual_no_signature/Main.snap b/tests-integration/fixtures/checking/037_value_mutual_no_signature/Main.snap index 111a5921..4356ea40 100644 --- a/tests-integration/fixtures/checking/037_value_mutual_no_signature/Main.snap +++ b/tests-integration/fixtures/checking/037_value_mutual_no_signature/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -f :: forall (t3 :: Type) (t6 :: Type). t6 -> t3 -g :: forall (t3 :: Type) (t6 :: Type). t6 -> t3 +f :: forall (t3 :: Type) (t6 :: Type). (t6 :: Type) -> (t3 :: Type) +g :: forall (t3 :: Type) (t6 :: Type). (t6 :: Type) -> (t3 :: Type) Types diff --git a/tests-integration/fixtures/checking/038_value_mutual_polytype/Main.snap b/tests-integration/fixtures/checking/038_value_mutual_polytype/Main.snap index 384fffb0..eb8e2936 100644 --- a/tests-integration/fixtures/checking/038_value_mutual_polytype/Main.snap +++ b/tests-integration/fixtures/checking/038_value_mutual_polytype/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -idRec :: forall (a :: Type). a -> a -choose :: forall (a :: Type). a -> a -> a +idRec :: forall (a :: Type). (a :: Type) -> (a :: Type) +choose :: forall (a :: Type). (a :: Type) -> (a :: Type) -> (a :: Type) Types diff --git a/tests-integration/fixtures/checking/039_value_mutual_multiple_type_variables/Main.snap b/tests-integration/fixtures/checking/039_value_mutual_multiple_type_variables/Main.snap index ae257c93..ce7149b1 100644 --- a/tests-integration/fixtures/checking/039_value_mutual_multiple_type_variables/Main.snap +++ b/tests-integration/fixtures/checking/039_value_mutual_multiple_type_variables/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -loop :: forall (t4 :: Type). t4 -> t4 -chooseFirst :: forall (a :: Type) (b :: Type). a -> b -> a +loop :: forall (t4 :: Type). (t4 :: Type) -> (t4 :: Type) +chooseFirst :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> (a :: Type) Types diff --git a/tests-integration/fixtures/checking/040_pattern_guard/Main.snap b/tests-integration/fixtures/checking/040_pattern_guard/Main.snap index 74076143..31b51064 100644 --- a/tests-integration/fixtures/checking/040_pattern_guard/Main.snap +++ b/tests-integration/fixtures/checking/040_pattern_guard/Main.snap @@ -5,7 +5,7 @@ expression: report Terms foo :: Int -> Int bar :: String -> String -foo' :: forall (t1 :: Type). t1 -> Int -bar' :: forall (t4 :: Type). t4 -> String +foo' :: forall (t1 :: Type). (t1 :: Type) -> Int +bar' :: forall (t4 :: Type). (t4 :: Type) -> String Types diff --git a/tests-integration/fixtures/checking/041_where_expression/Main.snap b/tests-integration/fixtures/checking/041_where_expression/Main.snap index 7ef1a9c0..26775003 100644 --- a/tests-integration/fixtures/checking/041_where_expression/Main.snap +++ b/tests-integration/fixtures/checking/041_where_expression/Main.snap @@ -3,11 +3,15 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -identity :: forall (t4 :: Type). t4 -> t4 +identity :: forall (t4 :: Type). (t4 :: Type) -> (t4 :: Type) compose :: - forall (t11 :: Type) (t12 :: Type) (t14 :: Type). (t12 -> t11) -> (t14 -> t12) -> t14 -> t11 -apply :: forall (t19 :: Type). t19 -> t19 -nested :: forall (t24 :: Type). t24 -> t24 + forall (t11 :: Type) (t12 :: Type) (t14 :: Type). + ((t12 :: Type) -> (t11 :: Type)) -> + ((t14 :: Type) -> (t12 :: Type)) -> + (t14 :: Type) -> + (t11 :: Type) +apply :: forall (t19 :: Type). (t19 :: Type) -> (t19 :: Type) +nested :: forall (t24 :: Type). (t24 :: Type) -> (t24 :: Type) multiPattern :: Boolean -> Int factorial :: Int -> Int diff --git a/tests-integration/fixtures/checking/042_where_polymorphic/Main.snap b/tests-integration/fixtures/checking/042_where_polymorphic/Main.snap index 9073a14c..c6ee89e2 100644 --- a/tests-integration/fixtures/checking/042_where_polymorphic/Main.snap +++ b/tests-integration/fixtures/checking/042_where_polymorphic/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -apply :: forall (t4 :: Type). t4 -> t4 -apply' :: forall (b :: Type). b -> b +apply :: forall (t4 :: Type). (t4 :: Type) -> (t4 :: Type) +apply' :: forall (b :: Type). (b :: Type) -> (b :: Type) Types diff --git a/tests-integration/fixtures/checking/043_binder_named/Main.snap b/tests-integration/fixtures/checking/043_binder_named/Main.snap index 38012248..f8f87d19 100644 --- a/tests-integration/fixtures/checking/043_binder_named/Main.snap +++ b/tests-integration/fixtures/checking/043_binder_named/Main.snap @@ -7,9 +7,9 @@ foo :: Int -> Int bar :: String -> String baz :: Int -> Int qux :: Int -foo' :: forall (t3 :: Type). t3 -> t3 -bar' :: forall (t6 :: Type). t6 -> t6 -baz' :: forall (t9 :: Type). t9 -> t9 +foo' :: forall (t3 :: Type). (t3 :: Type) -> (t3 :: Type) +bar' :: forall (t6 :: Type). (t6 :: Type) -> (t6 :: Type) +baz' :: forall (t9 :: Type). (t9 :: Type) -> (t9 :: Type) qux' :: Int Types diff --git a/tests-integration/fixtures/checking/044_binder_constructor/Main.snap b/tests-integration/fixtures/checking/044_binder_constructor/Main.snap index 8a1f7a69..a189e0b9 100644 --- a/tests-integration/fixtures/checking/044_binder_constructor/Main.snap +++ b/tests-integration/fixtures/checking/044_binder_constructor/Main.snap @@ -3,19 +3,19 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Pair :: forall (a :: Type) (b :: Type). a -> b -> Pair a b -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a -Nil :: forall (a :: Type). List a -Cons :: forall (a :: Type). a -> List a -> List a +Pair :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Pair (a :: Type) (b :: Type) +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +Nil :: forall (a :: Type). List (a :: Type) +Cons :: forall (a :: Type). (a :: Type) -> List (a :: Type) -> List (a :: Type) foo :: Pair Int String -> Int bar :: Maybe Int -> Int baz :: List Int -> Int qux :: Pair String String -> String -foo' :: forall (t15 :: Type) (t16 :: Type). Pair t16 t15 -> t16 +foo' :: forall (t15 :: Type) (t16 :: Type). Pair (t16 :: Type) (t15 :: Type) -> (t16 :: Type) bar' :: Maybe Int -> Int baz' :: List Int -> Int -qux' :: forall (t29 :: Type) (t30 :: Type). Pair t30 t29 -> t30 +qux' :: forall (t29 :: Type) (t30 :: Type). Pair (t30 :: Type) (t29 :: Type) -> (t30 :: Type) Types Pair :: Type -> Type -> Type diff --git a/tests-integration/fixtures/checking/045_do_discard/Main.snap b/tests-integration/fixtures/checking/045_do_discard/Main.snap index 17da3dd7..bb30847c 100644 --- a/tests-integration/fixtures/checking/045_do_discard/Main.snap +++ b/tests-integration/fixtures/checking/045_do_discard/Main.snap @@ -4,9 +4,13 @@ expression: report --- Terms Unit :: Unit -pure :: forall (a :: Type). a -> Effect a -bind :: forall (a :: Type) (b :: Type). Effect a -> (a -> Effect b) -> Effect b -discard :: forall (a :: Type) (b :: Type). Effect a -> (a -> Effect b) -> Effect b +pure :: forall (a :: Type). (a :: Type) -> Effect (a :: Type) +bind :: + forall (a :: Type) (b :: Type). + Effect (a :: Type) -> ((a :: Type) -> Effect (b :: Type)) -> Effect (b :: Type) +discard :: + forall (a :: Type) (b :: Type). + Effect (a :: Type) -> ((a :: Type) -> Effect (b :: Type)) -> Effect (b :: Type) unit :: Unit test :: Effect Unit test' :: Effect Unit diff --git a/tests-integration/fixtures/checking/046_do_bind/Main.snap b/tests-integration/fixtures/checking/046_do_bind/Main.snap index ba585cab..ca298046 100644 --- a/tests-integration/fixtures/checking/046_do_bind/Main.snap +++ b/tests-integration/fixtures/checking/046_do_bind/Main.snap @@ -3,10 +3,14 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -pure :: forall (a :: Type). a -> Effect a -bind :: forall (a :: Type) (b :: Type). Effect a -> (a -> Effect b) -> Effect b -discard :: forall (a :: Type) (b :: Type). Effect a -> (a -> Effect b) -> Effect b +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +pure :: forall (a :: Type). (a :: Type) -> Effect (a :: Type) +bind :: + forall (a :: Type) (b :: Type). + Effect (a :: Type) -> ((a :: Type) -> Effect (b :: Type)) -> Effect (b :: Type) +discard :: + forall (a :: Type) (b :: Type). + Effect (a :: Type) -> ((a :: Type) -> Effect (b :: Type)) -> Effect (b :: Type) test :: Effect (Tuple Int Int) test' :: Effect (Tuple Int Int) diff --git a/tests-integration/fixtures/checking/047_do_non_monadic/Main.snap b/tests-integration/fixtures/checking/047_do_non_monadic/Main.snap index e995bc82..fa9903c7 100644 --- a/tests-integration/fixtures/checking/047_do_non_monadic/Main.snap +++ b/tests-integration/fixtures/checking/047_do_non_monadic/Main.snap @@ -3,9 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -bind :: forall (a :: Type) (b :: Type). a -> (a -> b) -> b -discard :: forall (a :: Type) (b :: Type). a -> (a -> b) -> b +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +bind :: forall (a :: Type) (b :: Type). (a :: Type) -> ((a :: Type) -> (b :: Type)) -> (b :: Type) +discard :: + forall (a :: Type) (b :: Type). (a :: Type) -> ((a :: Type) -> (b :: Type)) -> (b :: Type) test :: Tuple Int String test' :: Tuple Int String diff --git a/tests-integration/fixtures/checking/048_do_non_monadic_discard/Main.snap b/tests-integration/fixtures/checking/048_do_non_monadic_discard/Main.snap index d21da071..204c622a 100644 --- a/tests-integration/fixtures/checking/048_do_non_monadic_discard/Main.snap +++ b/tests-integration/fixtures/checking/048_do_non_monadic_discard/Main.snap @@ -3,8 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -bind :: forall (a :: Type) (b :: Type). a -> (a -> b) -> b -discard :: forall (a :: Type) (b :: Type). a -> (a -> b) -> b +bind :: forall (a :: Type) (b :: Type). (a :: Type) -> ((a :: Type) -> (b :: Type)) -> (b :: Type) +discard :: + forall (a :: Type) (b :: Type). (a :: Type) -> ((a :: Type) -> (b :: Type)) -> (b :: Type) test :: Int test' :: Int diff --git a/tests-integration/fixtures/checking/049_ado_discard/Main.snap b/tests-integration/fixtures/checking/049_ado_discard/Main.snap index 4a47a052..45a77871 100644 --- a/tests-integration/fixtures/checking/049_ado_discard/Main.snap +++ b/tests-integration/fixtures/checking/049_ado_discard/Main.snap @@ -4,9 +4,13 @@ expression: report --- Terms Unit :: Unit -pure :: forall (a :: Type). a -> Effect a -map :: forall (a :: Type) (b :: Type). (a -> b) -> Effect a -> Effect b -apply :: forall (a :: Type) (b :: Type). Effect (a -> b) -> Effect a -> Effect b +pure :: forall (a :: Type). (a :: Type) -> Effect (a :: Type) +map :: + forall (a :: Type) (b :: Type). + ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) +apply :: + forall (a :: Type) (b :: Type). + Effect ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) unit :: Unit test :: Effect Unit test' :: Effect Unit diff --git a/tests-integration/fixtures/checking/050_ado_bind/Main.snap b/tests-integration/fixtures/checking/050_ado_bind/Main.snap index fa650034..2802a6bb 100644 --- a/tests-integration/fixtures/checking/050_ado_bind/Main.snap +++ b/tests-integration/fixtures/checking/050_ado_bind/Main.snap @@ -3,10 +3,14 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -pure :: forall (a :: Type). a -> Effect a -map :: forall (a :: Type) (b :: Type). (a -> b) -> Effect a -> Effect b -apply :: forall (a :: Type) (b :: Type). Effect (a -> b) -> Effect a -> Effect b +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +pure :: forall (a :: Type). (a :: Type) -> Effect (a :: Type) +map :: + forall (a :: Type) (b :: Type). + ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) +apply :: + forall (a :: Type) (b :: Type). + Effect ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) test :: Effect (Tuple Int Int) test' :: Effect (Tuple Int Int) diff --git a/tests-integration/fixtures/checking/051_ado_non_applicative/Main.snap b/tests-integration/fixtures/checking/051_ado_non_applicative/Main.snap index 6427d4d4..c30618de 100644 --- a/tests-integration/fixtures/checking/051_ado_non_applicative/Main.snap +++ b/tests-integration/fixtures/checking/051_ado_non_applicative/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -pure :: forall (a :: Type) (b :: Type). a -> b -map :: forall (a :: Type) (b :: Type). (a -> b) -> a -> b -apply :: forall (a :: Type) (b :: Type). (a -> b) -> a -> b +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +pure :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) +map :: forall (a :: Type) (b :: Type). ((a :: Type) -> (b :: Type)) -> (a :: Type) -> (b :: Type) +apply :: forall (a :: Type) (b :: Type). ((a :: Type) -> (b :: Type)) -> (a :: Type) -> (b :: Type) test :: Tuple Int String test' :: Tuple Int String diff --git a/tests-integration/fixtures/checking/052_ado_non_applicative_discard/Main.snap b/tests-integration/fixtures/checking/052_ado_non_applicative_discard/Main.snap index dc05caec..b3376b3b 100644 --- a/tests-integration/fixtures/checking/052_ado_non_applicative_discard/Main.snap +++ b/tests-integration/fixtures/checking/052_ado_non_applicative_discard/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -pure :: forall (a :: Type) (b :: Type). a -> b -map :: forall (a :: Type) (b :: Type). (a -> b) -> a -> b -apply :: forall (a :: Type) (b :: Type). (a -> b) -> a -> b +pure :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) +map :: forall (a :: Type) (b :: Type). ((a :: Type) -> (b :: Type)) -> (a :: Type) -> (b :: Type) +apply :: forall (a :: Type) (b :: Type). ((a :: Type) -> (b :: Type)) -> (a :: Type) -> (b :: Type) test :: Int test' :: Int diff --git a/tests-integration/fixtures/checking/053_do_polymorphic/Main.snap b/tests-integration/fixtures/checking/053_do_polymorphic/Main.snap index 74fc7804..2d5f239b 100644 --- a/tests-integration/fixtures/checking/053_do_polymorphic/Main.snap +++ b/tests-integration/fixtures/checking/053_do_polymorphic/Main.snap @@ -3,12 +3,20 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -bind :: forall (m :: Type -> Type) (a :: Type) (b :: Type). m a -> (a -> m b) -> m b -discard :: forall (m :: Type -> Type) (a :: Type) (b :: Type). m a -> (a -> m b) -> m b -pure :: forall (m :: Type -> Type) (a :: Type). a -> m a -test :: forall (m :: Type -> Type). m (Tuple Int String) -test' :: forall (t58 :: Type -> Type). t58 (Tuple Int String) +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +bind :: + forall (m :: Type -> Type) (a :: Type) (b :: Type). + (m :: Type -> Type) (a :: Type) -> + ((a :: Type) -> (m :: Type -> Type) (b :: Type)) -> + (m :: Type -> Type) (b :: Type) +discard :: + forall (m :: Type -> Type) (a :: Type) (b :: Type). + (m :: Type -> Type) (a :: Type) -> + ((a :: Type) -> (m :: Type -> Type) (b :: Type)) -> + (m :: Type -> Type) (b :: Type) +pure :: forall (m :: Type -> Type) (a :: Type). (a :: Type) -> (m :: Type -> Type) (a :: Type) +test :: forall (m :: Type -> Type). (m :: Type -> Type) (Tuple Int String) +test' :: forall (t58 :: Type -> Type). (t58 :: Type -> Type) (Tuple Int String) Types Tuple :: Type -> Type -> Type diff --git a/tests-integration/fixtures/checking/054_ado_polymorphic/Main.snap b/tests-integration/fixtures/checking/054_ado_polymorphic/Main.snap index 6fc9f5f5..8d7a062a 100644 --- a/tests-integration/fixtures/checking/054_ado_polymorphic/Main.snap +++ b/tests-integration/fixtures/checking/054_ado_polymorphic/Main.snap @@ -3,12 +3,20 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -map :: forall (f :: Type -> Type) (a :: Type) (b :: Type). (a -> b) -> f a -> f b -apply :: forall (f :: Type -> Type) (a :: Type) (b :: Type). f (a -> b) -> f a -> f b -pure :: forall (f :: Type -> Type) (a :: Type). a -> f a -test :: forall (f :: Type -> Type). f (Tuple Int String) -test' :: forall (t54 :: Type -> Type). t54 (Tuple Int String) +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +map :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +apply :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + (f :: Type -> Type) ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +pure :: forall (f :: Type -> Type) (a :: Type). (a :: Type) -> (f :: Type -> Type) (a :: Type) +test :: forall (f :: Type -> Type). (f :: Type -> Type) (Tuple Int String) +test' :: forall (t54 :: Type -> Type). (t54 :: Type -> Type) (Tuple Int String) Types Tuple :: Type -> Type -> Type diff --git a/tests-integration/fixtures/checking/055_array/Main.snap b/tests-integration/fixtures/checking/055_array/Main.snap index ed75944a..4037e64a 100644 --- a/tests-integration/fixtures/checking/055_array/Main.snap +++ b/tests-integration/fixtures/checking/055_array/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -id :: forall (a :: Type). a -> a +id :: forall (a :: Type). (a :: Type) -> (a :: Type) monomorphic :: Array Int -polymorphic :: forall (t8 :: Type). Array (t8 -> t8) +polymorphic :: forall (t8 :: Type). Array ((t8 :: Type) -> (t8 :: Type)) Types diff --git a/tests-integration/fixtures/checking/056_record/Main.snap b/tests-integration/fixtures/checking/056_record/Main.snap index bd09cab5..0505792c 100644 --- a/tests-integration/fixtures/checking/056_record/Main.snap +++ b/tests-integration/fixtures/checking/056_record/Main.snap @@ -4,8 +4,12 @@ expression: report --- Terms label :: { a :: Int, b :: String } -field :: forall (t4 :: Type) (t5 :: Type). t4 -> t5 -> { a :: t4, b :: t5 } -id :: forall (a :: Type). a -> a -polymorphic :: forall (t9 :: Type) (t10 :: Type). { a :: t9 -> t9, b :: t10 -> t10 } +field :: + forall (t4 :: Type) (t5 :: Type). + (t4 :: Type) -> (t5 :: Type) -> { a :: (t4 :: Type), b :: (t5 :: Type) } +id :: forall (a :: Type). (a :: Type) -> (a :: Type) +polymorphic :: + forall (t9 :: Type) (t10 :: Type). + { a :: (t9 :: Type) -> (t9 :: Type), b :: (t10 :: Type) -> (t10 :: Type) } Types diff --git a/tests-integration/fixtures/checking/058_binder_operator_chain/Main.snap b/tests-integration/fixtures/checking/058_binder_operator_chain/Main.snap index 4779edfd..b84b0f45 100644 --- a/tests-integration/fixtures/checking/058_binder_operator_chain/Main.snap +++ b/tests-integration/fixtures/checking/058_binder_operator_chain/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nil :: forall (a :: Type). List a -Cons :: forall (a :: Type). a -> List a -> List a -: :: forall (a :: Type). a -> List a -> List a +Nil :: forall (a :: Type). List (a :: Type) +Cons :: forall (a :: Type). (a :: Type) -> List (a :: Type) -> List (a :: Type) +: :: forall (a :: Type). (a :: Type) -> List (a :: Type) -> List (a :: Type) matchCons :: List Int -> Int matchSingle :: List Int -> Int matchCons' :: List Int -> Int diff --git a/tests-integration/fixtures/checking/059_term_infix_chain/Main.snap b/tests-integration/fixtures/checking/059_term_infix_chain/Main.snap index f781b092..24ec198b 100644 --- a/tests-integration/fixtures/checking/059_term_infix_chain/Main.snap +++ b/tests-integration/fixtures/checking/059_term_infix_chain/Main.snap @@ -12,16 +12,20 @@ test2 :: Int test2' :: Int test3 :: Int test3' :: Int -const :: forall (a :: Type) (b :: Type). a -> b -> a +const :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> (a :: Type) test4 :: Int test4' :: Int test5 :: Int test5' :: Int -apply :: forall (a :: Type) (b :: Type). (a -> b) -> a -> b -chain :: forall (a :: Type) (b :: Type) (c :: Type). (b -> c) -> (a -> b) -> a -> c +apply :: forall (a :: Type) (b :: Type). ((a :: Type) -> (b :: Type)) -> (a :: Type) -> (b :: Type) +chain :: + forall (a :: Type) (b :: Type) (c :: Type). + ((b :: Type) -> (c :: Type)) -> ((a :: Type) -> (b :: Type)) -> (a :: Type) -> (c :: Type) test6 :: Int test6' :: Int -curry :: forall (a :: Type) (b :: Type) (c :: Type). (a -> b -> c) -> a -> b -> c +curry :: + forall (a :: Type) (b :: Type) (c :: Type). + ((a :: Type) -> (b :: Type) -> (c :: Type)) -> (a :: Type) -> (b :: Type) -> (c :: Type) test7 :: Int -> Int test7' :: Int -> Int diff --git a/tests-integration/fixtures/checking/060_array_binder/Main.snap b/tests-integration/fixtures/checking/060_array_binder/Main.snap index 2814c662..fbc354c0 100644 --- a/tests-integration/fixtures/checking/060_array_binder/Main.snap +++ b/tests-integration/fixtures/checking/060_array_binder/Main.snap @@ -4,12 +4,12 @@ expression: report --- Terms test1 :: Array Int -> { x :: Int, y :: Int } -test1' :: forall (t6 :: Type). Array t6 -> { x :: t6, y :: t6 } -test2 :: forall (a :: Type). Array a -> Array a -test2' :: forall (t21 :: Type). Array t21 -> Array t21 +test1' :: forall (t6 :: Type). Array (t6 :: Type) -> { x :: (t6 :: Type), y :: (t6 :: Type) } +test2 :: forall (a :: Type). Array (a :: Type) -> Array (a :: Type) +test2' :: forall (t21 :: Type). Array (t21 :: Type) -> Array (t21 :: Type) test3 :: Array Int -> Int test3' :: Array Int -> Int nested :: Array (Array Int) -> Int -nested' :: forall (t53 :: Type). Array (Array t53) -> t53 +nested' :: forall (t53 :: Type). Array (Array (t53 :: Type)) -> (t53 :: Type) Types diff --git a/tests-integration/fixtures/checking/061_record_binder/Main.snap b/tests-integration/fixtures/checking/061_record_binder/Main.snap index c8f072ef..b5887cdb 100644 --- a/tests-integration/fixtures/checking/061_record_binder/Main.snap +++ b/tests-integration/fixtures/checking/061_record_binder/Main.snap @@ -4,12 +4,17 @@ expression: report --- Terms test1 :: { x :: Int, y :: Int } -> Int -test1' :: forall (t10 :: Type) (t11 :: Type). { x :: t11, y :: t10 } -> t11 +test1' :: + forall (t10 :: Type) (t11 :: Type). { x :: (t11 :: Type), y :: (t10 :: Type) } -> (t11 :: Type) test2 :: { x :: Int, y :: String } -> { x :: Int, y :: String } -test2' :: forall (t15 :: Type) (t16 :: Type). { x :: t15, y :: t16 } -> { x :: t15, y :: t16 } +test2' :: + forall (t15 :: Type) (t16 :: Type). + { x :: (t15 :: Type), y :: (t16 :: Type) } -> { x :: (t15 :: Type), y :: (t16 :: Type) } test3 :: { age :: Int, name :: String } -> String -test3' :: forall (t22 :: Type) (t23 :: Type). { age :: t22, name :: t23 } -> t23 +test3' :: + forall (t22 :: Type) (t23 :: Type). + { age :: (t22 :: Type), name :: (t23 :: Type) } -> (t23 :: Type) nested :: { inner :: { x :: Int } } -> Int -nested' :: forall (t27 :: Type). { inner :: { x :: t27 } } -> t27 +nested' :: forall (t27 :: Type). { inner :: { x :: (t27 :: Type) } } -> (t27 :: Type) Types diff --git a/tests-integration/fixtures/checking/062_case_of/Main.snap b/tests-integration/fixtures/checking/062_case_of/Main.snap index 41dd6995..248a51db 100644 --- a/tests-integration/fixtures/checking/062_case_of/Main.snap +++ b/tests-integration/fixtures/checking/062_case_of/Main.snap @@ -3,17 +3,17 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Just :: forall (a :: Type). a -> Maybe a -Nothing :: forall (a :: Type). Maybe a -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +Nothing :: forall (a :: Type). Maybe (a :: Type) +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) test1 :: Maybe Int -> Int test1' :: Maybe Int -> Int test2 :: Maybe Int -> Maybe Int -> Int test2' :: Maybe Int -> Maybe Int -> Int test3 :: Either Int String -> Int -test3' :: forall (t46 :: Type). Either Int t46 -> Int +test3' :: forall (t46 :: Type). Either Int (t46 :: Type) -> Int test4 :: Tuple (Maybe Int) (Maybe Int) -> Int test4' :: Tuple (Maybe Int) (Maybe Int) -> Int diff --git a/tests-integration/fixtures/checking/063_negate/Main.snap b/tests-integration/fixtures/checking/063_negate/Main.snap index 3c13ad4e..ed6f3953 100644 --- a/tests-integration/fixtures/checking/063_negate/Main.snap +++ b/tests-integration/fixtures/checking/063_negate/Main.snap @@ -3,13 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -negate :: forall (a :: Type). a -> a +negate :: forall (a :: Type). (a :: Type) -> (a :: Type) testInt :: Int testInt' :: Int testNumber :: Number testNumber' :: Number testVariable :: Int -> Int -testVariable' :: forall (t12 :: Type). t12 -> t12 +testVariable' :: forall (t12 :: Type). (t12 :: Type) -> (t12 :: Type) testNested :: Int testNested' :: Int diff --git a/tests-integration/fixtures/checking/064_negate_local/Main.snap b/tests-integration/fixtures/checking/064_negate_local/Main.snap index 8850f2fa..e2411405 100644 --- a/tests-integration/fixtures/checking/064_negate_local/Main.snap +++ b/tests-integration/fixtures/checking/064_negate_local/Main.snap @@ -3,12 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -negate :: forall (a :: Type). a -> a +negate :: forall (a :: Type). (a :: Type) -> (a :: Type) testRecord :: { a :: Int, b :: Int } testRecord' :: { a :: Int, b :: Int } testArray :: Array Int testArray' :: Array Int testFunction :: Int -> Int -testFunction' :: forall (t28 :: Type). t28 -> Int +testFunction' :: forall (t28 :: Type). (t28 :: Type) -> Int Types diff --git a/tests-integration/fixtures/checking/065_do_collector/Main.snap b/tests-integration/fixtures/checking/065_do_collector/Main.snap index 371c8f3c..28952c3e 100644 --- a/tests-integration/fixtures/checking/065_do_collector/Main.snap +++ b/tests-integration/fixtures/checking/065_do_collector/Main.snap @@ -5,11 +5,15 @@ expression: report Terms bind :: forall (a :: Type) (b :: Type) (x :: Type) (y :: Type). - Collector x a -> (a -> Collector y b) -> Collector (Tuple x y) b + Collector (x :: Type) (a :: Type) -> + ((a :: Type) -> Collector (y :: Type) (b :: Type)) -> + Collector (Tuple (x :: Type) (y :: Type)) (b :: Type) discard :: forall (a :: Type) (b :: Type) (x :: Type) (y :: Type). - Collector x a -> (a -> Collector y b) -> Collector (Tuple x y) b -pure :: forall (a :: Type). a -> Collector a a + Collector (x :: Type) (a :: Type) -> + ((a :: Type) -> Collector (y :: Type) (b :: Type)) -> + Collector (Tuple (x :: Type) (y :: Type)) (b :: Type) +pure :: forall (a :: Type). (a :: Type) -> Collector (a :: Type) (a :: Type) test1 :: Collector (Tuple Int (Tuple String (Tuple Char { x :: Int, y :: String, z :: Char }))) diff --git a/tests-integration/fixtures/checking/066_ado_collector/Main.snap b/tests-integration/fixtures/checking/066_ado_collector/Main.snap index 5670b4cb..15125111 100644 --- a/tests-integration/fixtures/checking/066_ado_collector/Main.snap +++ b/tests-integration/fixtures/checking/066_ado_collector/Main.snap @@ -5,17 +5,25 @@ expression: report Terms map :: forall (a :: Type) (b :: Type) (x :: Type) (y :: Type). - (a -> b) -> Collector x a -> Collector (Tuple x y) b + ((a :: Type) -> (b :: Type)) -> + Collector (x :: Type) (a :: Type) -> + Collector (Tuple (x :: Type) (y :: Type)) (b :: Type) apply :: forall (a :: Type) (b :: Type) (x :: Type) (y :: Type). - Collector x (a -> b) -> Collector y a -> Collector (Tuple x y) b -pure :: forall (a :: Type). a -> Collector a a + Collector (x :: Type) ((a :: Type) -> (b :: Type)) -> + Collector (y :: Type) (a :: Type) -> + Collector (Tuple (x :: Type) (y :: Type)) (b :: Type) +pure :: forall (a :: Type). (a :: Type) -> Collector (a :: Type) (a :: Type) test1 :: forall (t18 :: Type). - Collector (Tuple (Tuple (Tuple Int t18) String) Char) { x :: Int, y :: String, z :: Char } + Collector + (Tuple (Tuple (Tuple Int (t18 :: Type)) String) Char) + { x :: Int, y :: String, z :: Char } test2 :: - forall (t37 :: Type). Collector (Tuple (Tuple Char t37) Boolean) { x :: Char, y :: Boolean } -test3 :: forall (t51 :: Type). Collector (Tuple (Tuple Int t51) String) { x :: Int, z :: String } + forall (t37 :: Type). + Collector (Tuple (Tuple Char (t37 :: Type)) Boolean) { x :: Char, y :: Boolean } +test3 :: + forall (t51 :: Type). Collector (Tuple (Tuple Int (t51 :: Type)) String) { x :: Int, z :: String } Types Collector :: Type -> Type -> Type diff --git a/tests-integration/fixtures/checking/067_ado_let/Main.snap b/tests-integration/fixtures/checking/067_ado_let/Main.snap index 15e2ea79..1447d852 100644 --- a/tests-integration/fixtures/checking/067_ado_let/Main.snap +++ b/tests-integration/fixtures/checking/067_ado_let/Main.snap @@ -3,9 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -pure :: forall (a :: Type). a -> Effect a -map :: forall (a :: Type) (b :: Type). (a -> b) -> Effect a -> Effect b -apply :: forall (a :: Type) (b :: Type). Effect (a -> b) -> Effect a -> Effect b +pure :: forall (a :: Type). (a :: Type) -> Effect (a :: Type) +map :: + forall (a :: Type) (b :: Type). + ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) +apply :: + forall (a :: Type) (b :: Type). + Effect ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) test :: Effect { x :: Int, y :: { x :: Int }, z :: String } Types diff --git a/tests-integration/fixtures/checking/068_expression_sections/Main.snap b/tests-integration/fixtures/checking/068_expression_sections/Main.snap index 90d55e2f..5d3feda1 100644 --- a/tests-integration/fixtures/checking/068_expression_sections/Main.snap +++ b/tests-integration/fixtures/checking/068_expression_sections/Main.snap @@ -4,25 +4,31 @@ expression: report --- Terms + :: Int -> Int -> Int -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) add :: Int -> Int -> Int negate :: Int -> Int test1 :: Int -> Int test2 :: Int -> Int test3 :: Int -> Int -> Int -test4 :: forall (t15 :: Type) (t16 :: Row Type). { foo :: t15 | t16 } -> t15 -test5 :: forall (t20 :: Type) (t21 :: Row Type). { foo :: t20 | t21 } -> { foo :: Int | t21 } -test6 :: forall (t27 :: Type). Boolean -> t27 -> t27 -> t27 +test4 :: + forall (t15 :: Type) (t16 :: Row Type). + { foo :: (t15 :: Type) | (t16 :: Row Type) } -> (t15 :: Type) +test5 :: + forall (t20 :: Type) (t21 :: Row Type). + { foo :: (t20 :: Type) | (t21 :: Row Type) } -> { foo :: Int | (t21 :: Row Type) } +test6 :: forall (t27 :: Type). Boolean -> (t27 :: Type) -> (t27 :: Type) -> (t27 :: Type) test7 :: Int -> Int test8 :: Int -> Int test9 :: Int -> Int -> Int -test10 :: forall (t41 :: Type). ((Int -> Int) -> t41) -> t41 -test11 :: forall (t48 :: Type). t48 -> Array t48 -test12 :: forall (t51 :: Type). t51 -> { foo :: t51 } -test13 :: forall (t54 :: Type). t54 -> t54 -test14 :: forall (t59 :: Type). t59 -> t59 -> Array t59 -test15 :: forall (t62 :: Type) (t63 :: Type). t62 -> t63 -> { a :: t62, b :: t63 } -test16 :: forall (t67 :: Type). t67 -> Tuple t67 Int +test10 :: forall (t41 :: Type). ((Int -> Int) -> (t41 :: Type)) -> (t41 :: Type) +test11 :: forall (t48 :: Type). (t48 :: Type) -> Array (t48 :: Type) +test12 :: forall (t51 :: Type). (t51 :: Type) -> { foo :: (t51 :: Type) } +test13 :: forall (t54 :: Type). (t54 :: Type) -> (t54 :: Type) +test14 :: forall (t59 :: Type). (t59 :: Type) -> (t59 :: Type) -> Array (t59 :: Type) +test15 :: + forall (t62 :: Type) (t63 :: Type). + (t62 :: Type) -> (t63 :: Type) -> { a :: (t62 :: Type), b :: (t63 :: Type) } +test16 :: forall (t67 :: Type). (t67 :: Type) -> Tuple (t67 :: Type) Int test17 :: Tuple String Int test18 :: Int -> Int diff --git a/tests-integration/fixtures/checking/069_expression_sections_inference/Main.snap b/tests-integration/fixtures/checking/069_expression_sections_inference/Main.snap index ed131a4a..8504e122 100644 --- a/tests-integration/fixtures/checking/069_expression_sections_inference/Main.snap +++ b/tests-integration/fixtures/checking/069_expression_sections_inference/Main.snap @@ -7,10 +7,12 @@ Terms - :: Int -> Int -> Int add :: Int -> Int -> Int sub :: Int -> Int -> Int -identity :: forall (a :: Type). a -> a +identity :: forall (a :: Type). (a :: Type) -> (a :: Type) test1 :: Int -> String -> { a :: Int, b :: String } test2 :: - forall (t13 :: Type) (t16 :: Type) (t17 :: Type). (((t16 -> t17) -> t16 -> t17) -> t13) -> t13 + forall (t13 :: Type) (t16 :: Type) (t17 :: Type). + ((((t16 :: Type) -> (t17 :: Type)) -> (t16 :: Type) -> (t17 :: Type)) -> (t13 :: Type)) -> + (t13 :: Type) test3 :: Boolean -> Int -> Int test4 :: Int test5 :: { x :: Int, y :: Int | () } diff --git a/tests-integration/fixtures/checking/070_record_access_sections/Main.snap b/tests-integration/fixtures/checking/070_record_access_sections/Main.snap index 68781675..e1dbcd67 100644 --- a/tests-integration/fixtures/checking/070_record_access_sections/Main.snap +++ b/tests-integration/fixtures/checking/070_record_access_sections/Main.snap @@ -3,36 +3,61 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -map :: forall (a :: Type) (b :: Type). (a -> b) -> Array a -> Array b -apply :: forall (a :: Type) (b :: Type). (a -> b) -> a -> b +map :: + forall (a :: Type) (b :: Type). + ((a :: Type) -> (b :: Type)) -> Array (a :: Type) -> Array (b :: Type) +apply :: forall (a :: Type) (b :: Type). ((a :: Type) -> (b :: Type)) -> (a :: Type) -> (b :: Type) f :: ({ foo :: Int } -> Int) -> Int -test1 :: forall (t9 :: Type) (t10 :: Row Type). { prop :: t9 | t10 } -> t9 +test1 :: + forall (t9 :: Type) (t10 :: Row Type). + { prop :: (t9 :: Type) | (t10 :: Row Type) } -> (t9 :: Type) test2 :: forall (t15 :: Row Type) (t17 :: Row Type) (t18 :: Type) (t19 :: Row Type). - { a :: { b :: { c :: t18 | t19 } | t17 } | t15 } -> t18 -test3 :: forall (t23 :: Type) (t24 :: Row Type). { poly :: t23 | t24 } -> t23 -test4 :: forall (t28 :: Type) (t31 :: Row Type). Array { prop :: t28 | t31 } -> Array t28 + { a :: { b :: { c :: (t18 :: Type) | (t19 :: Row Type) } | (t17 :: Row Type) } + | (t15 :: Row Type) + } -> + (t18 :: Type) +test3 :: + forall (t23 :: Type) (t24 :: Row Type). + { poly :: (t23 :: Type) | (t24 :: Row Type) } -> (t23 :: Type) +test4 :: + forall (t28 :: Type) (t31 :: Row Type). + Array { prop :: (t28 :: Type) | (t31 :: Row Type) } -> Array (t28 :: Type) test5 :: Int test6 :: forall (t39 :: Type) (t41 :: Type) (t45 :: Type) (t46 :: Row Type). - t39 -> (({ bar :: t45 | t46 } -> t45) -> t41) -> t41 -test7 :: forall (t51 :: Type) (t52 :: Row Type). { nonexistent :: t51 | t52 } -> t51 + (t39 :: Type) -> + (({ bar :: (t45 :: Type) | (t46 :: Row Type) } -> (t45 :: Type)) -> (t41 :: Type)) -> + (t41 :: Type) +test7 :: + forall (t51 :: Type) (t52 :: Row Type). + { nonexistent :: (t51 :: Type) | (t52 :: Row Type) } -> (t51 :: Type) test8 :: forall (t57 :: Type) (t59 :: Type) (t60 :: Row Type). - (({ foo :: t59 | t60 } -> t59) -> t57) -> t57 + (({ foo :: (t59 :: Type) | (t60 :: Row Type) } -> (t59 :: Type)) -> (t57 :: Type)) -> + (t57 :: Type) test9 :: forall (t64 :: Type) (t69 :: Type) (t70 :: Row Type). - Array (({ prop :: t69 | t70 } -> t69) -> t64) -> Array t64 + Array (({ prop :: (t69 :: Type) | (t70 :: Row Type) } -> (t69 :: Type)) -> (t64 :: Type)) -> + Array (t64 :: Type) test10 :: - forall (t74 :: Type) (t77 :: Row Type) (t79 :: Row Type). { a :: { b :: t74 | t79 } | t77 } -> t74 + forall (t74 :: Type) (t77 :: Row Type) (t79 :: Row Type). + { a :: { b :: (t74 :: Type) | (t79 :: Row Type) } | (t77 :: Row Type) } -> (t74 :: Type) test11 :: forall (t82 :: Type) (t84 :: Type) (t85 :: Row Type). - t82 -> { a :: t82, b :: { foo :: t84 | t85 } -> t84 } + (t82 :: Type) -> + { a :: (t82 :: Type), b :: { foo :: (t84 :: Type) | (t85 :: Row Type) } -> (t84 :: Type) } test12 :: forall (t91 :: Type) (t92 :: Row Type). - ({ bar :: t91 | t92 } -> t91) -> Array ({ bar :: t91 | t92 } -> t91) -test13 :: forall (t95 :: Type) (t98 :: Type) (t99 :: Row Type). t95 -> { prop :: t98 | t99 } -> t98 + ({ bar :: (t91 :: Type) | (t92 :: Row Type) } -> (t91 :: Type)) -> + Array ({ bar :: (t91 :: Type) | (t92 :: Row Type) } -> (t91 :: Type)) +test13 :: + forall (t95 :: Type) (t98 :: Type) (t99 :: Row Type). + (t95 :: Type) -> { prop :: (t98 :: Type) | (t99 :: Row Type) } -> (t98 :: Type) test14 :: - forall (t105 :: Type) (t110 :: Row Type). Boolean -> { a :: t105 | ( b :: t105 | t110 ) } -> t105 + forall (t105 :: Type) (t110 :: Row Type). + Boolean -> + { a :: (t105 :: Type) | ( b :: (t105 :: Type) | (t110 :: Row Type) ) } -> + (t105 :: Type) Types diff --git a/tests-integration/fixtures/checking/071_record_update_sections/Main.snap b/tests-integration/fixtures/checking/071_record_update_sections/Main.snap index add25f16..17a42b0e 100644 --- a/tests-integration/fixtures/checking/071_record_update_sections/Main.snap +++ b/tests-integration/fixtures/checking/071_record_update_sections/Main.snap @@ -3,37 +3,56 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -singleFieldUpdate :: forall (t5 :: Type) (t6 :: Row Type). { a :: t5 | t6 } -> { a :: Int | t6 } +singleFieldUpdate :: + forall (t5 :: Type) (t6 :: Row Type). + { a :: (t5 :: Type) | (t6 :: Row Type) } -> { a :: Int | (t6 :: Row Type) } multipleFieldUpdate :: forall (t10 :: Type) (t11 :: Type) (t12 :: Type) (t13 :: Row Type). - { a :: t10, b :: t11, c :: t12 | t13 } -> { a :: Int, b :: Boolean, c :: String | t13 } + { a :: (t10 :: Type), b :: (t11 :: Type), c :: (t12 :: Type) | (t13 :: Row Type) } -> + { a :: Int, b :: Boolean, c :: String | (t13 :: Row Type) } nestedRecordUpdate :: forall (t17 :: Type) (t18 :: Row Type) (t19 :: Row Type) (t20 :: Row Type). - { a :: { b :: { c :: t17 | t18 } | t19 } | t20 } -> - { a :: { b :: { c :: Int | t18 } | t19 } | t20 } + { a :: { b :: { c :: (t17 :: Type) | (t18 :: Row Type) } | (t19 :: Row Type) } + | (t20 :: Row Type) + } -> + { a :: { b :: { c :: Int | (t18 :: Row Type) } | (t19 :: Row Type) } | (t20 :: Row Type) } updateWithValueSection :: - forall (t24 :: Type) (t26 :: Row Type). { a :: t24 | t26 } -> { a :: Int -> Int | t26 } + forall (t24 :: Type) (t26 :: Row Type). + { a :: (t24 :: Type) | (t26 :: Row Type) } -> { a :: Int -> Int | (t26 :: Row Type) } updateWithSectionInteraction :: forall (t30 :: Type) (t31 :: Type) (t32 :: Row Type). - { a :: t31 | t32 } -> t30 -> { a :: t30 | t32 } + { a :: (t31 :: Type) | (t32 :: Row Type) } -> + (t30 :: Type) -> + { a :: (t30 :: Type) | (t32 :: Row Type) } polymorphicRecordUpdate :: - forall (t36 :: Type) (t37 :: Row Type). { foo :: t36 | t37 } -> { foo :: Int | t37 } + forall (t36 :: Type) (t37 :: Row Type). + { foo :: (t36 :: Type) | (t37 :: Row Type) } -> { foo :: Int | (t37 :: Row Type) } higherOrderContext :: - forall (t44 :: Type) (t45 :: Row Type). Array { x :: t44 | t45 } -> Array { x :: Int | t45 } + forall (t44 :: Type) (t45 :: Row Type). + Array { x :: (t44 :: Type) | (t45 :: Row Type) } -> Array { x :: Int | (t45 :: Row Type) } multipleSectionsInteraction :: forall (t49 :: Type) (t50 :: Type) (t51 :: Type) (t52 :: Type) (t53 :: Row Type). - { x :: t51, y :: t52 | t53 } -> t49 -> t50 -> { x :: t49, y :: t50 | t53 } + { x :: (t51 :: Type), y :: (t52 :: Type) | (t53 :: Row Type) } -> + (t49 :: Type) -> + (t50 :: Type) -> + { x :: (t49 :: Type), y :: (t50 :: Type) | (t53 :: Row Type) } nestedSectionInteraction :: forall (t57 :: Type) (t58 :: Type) (t59 :: Row Type) (t60 :: Row Type). - { a :: { b :: t58 | t59 } | t60 } -> t57 -> { a :: { b :: t57 | t59 } | t60 } + { a :: { b :: (t58 :: Type) | (t59 :: Row Type) } | (t60 :: Row Type) } -> + (t57 :: Type) -> + { a :: { b :: (t57 :: Type) | (t59 :: Row Type) } | (t60 :: Row Type) } mixedSections :: forall (t64 :: Type) (t66 :: Type) (t67 :: Row Type). - { a :: t64, b :: t66 | t67 } -> { a :: Int -> Int, b :: Int | t67 } + { a :: (t64 :: Type), b :: (t66 :: Type) | (t67 :: Row Type) } -> + { a :: Int -> Int, b :: Int | (t67 :: Row Type) } recordAccessSectionUpdate :: forall (t71 :: Type) (t73 :: Type) (t74 :: Row Type) (t75 :: Row Type). - { a :: t71 | t75 } -> { a :: { b :: t73 | t74 } -> t73 | t75 } -concreteRecordUpdateSection :: forall (t78 :: Type). t78 -> { a :: t78 | () } -map :: forall (a :: Type) (b :: Type). (a -> b) -> Array a -> Array b + { a :: (t71 :: Type) | (t75 :: Row Type) } -> + { a :: { b :: (t73 :: Type) | (t74 :: Row Type) } -> (t73 :: Type) | (t75 :: Row Type) } +concreteRecordUpdateSection :: forall (t78 :: Type). (t78 :: Type) -> { a :: (t78 :: Type) | () } +map :: + forall (a :: Type) (b :: Type). + ((a :: Type) -> (b :: Type)) -> Array (a :: Type) -> Array (b :: Type) + :: Int -> Int -> Int add :: Int -> Int -> Int diff --git a/tests-integration/fixtures/checking/072_inspect_synonym_forall/Main.snap b/tests-integration/fixtures/checking/072_inspect_synonym_forall/Main.snap index 7aea6dba..88b9f40f 100644 --- a/tests-integration/fixtures/checking/072_inspect_synonym_forall/Main.snap +++ b/tests-integration/fixtures/checking/072_inspect_synonym_forall/Main.snap @@ -3,20 +3,20 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -identity :: forall (a :: Type). a -> a -const :: forall (a :: Type) (b :: Type). a -> b -> a +identity :: forall (a :: Type). (a :: Type) -> (a :: Type) +const :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> (a :: Type) Types Identity :: Type Const :: Type Synonyms -Identity = forall (a :: Type). a -> a +Identity = forall (a :: Type). (a :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :0 -Const = forall (a :: Type) (b :: Type). a -> b -> a +Const = forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :0 diff --git a/tests-integration/fixtures/checking/073_inspect_synonym_return/Main.snap b/tests-integration/fixtures/checking/073_inspect_synonym_return/Main.snap index 897a95b9..631c931a 100644 --- a/tests-integration/fixtures/checking/073_inspect_synonym_return/Main.snap +++ b/tests-integration/fixtures/checking/073_inspect_synonym_return/Main.snap @@ -3,21 +3,23 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -test1 :: forall (a :: Type). a -> ReturnsInt a -test2 :: forall (a :: Type). ReturnsInt a -> ReturnsInt a -test3 :: forall (a :: Type) (b :: Type). a -> b -> ReturnsResult a b +test1 :: forall (a :: Type). (a :: Type) -> ReturnsInt (a :: Type) +test2 :: forall (a :: Type). ReturnsInt (a :: Type) -> ReturnsInt (a :: Type) +test3 :: + forall (a :: Type) (b :: Type). + (a :: Type) -> (b :: Type) -> ReturnsResult (a :: Type) (b :: Type) Types ReturnsInt :: Type -> Type ReturnsResult :: Type -> Type -> Type Synonyms -ReturnsInt = forall (a :: Type). a -> Int +ReturnsInt = forall (a :: Type). (a :: Type) -> Int Quantified = :0 Kind = :0 Type = :1 -ReturnsResult = forall (a :: Type) (b :: Type). a -> b -> Int +ReturnsResult = forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Int Quantified = :0 Kind = :0 Type = :2 diff --git a/tests-integration/fixtures/checking/074_inspect_nested_forall/Main.snap b/tests-integration/fixtures/checking/074_inspect_nested_forall/Main.snap index 77bc3391..b334fdd1 100644 --- a/tests-integration/fixtures/checking/074_inspect_nested_forall/Main.snap +++ b/tests-integration/fixtures/checking/074_inspect_nested_forall/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -const :: forall (a :: Type). a -> ForConst a -triple :: forall (a :: Type). a -> TripleForall a -flip :: forall (a :: Type). Flip a +const :: forall (a :: Type). (a :: Type) -> ForConst (a :: Type) +triple :: forall (a :: Type). (a :: Type) -> TripleForall (a :: Type) +flip :: forall (a :: Type). Flip (a :: Type) Types ForConst :: Type -> Type @@ -13,17 +13,18 @@ TripleForall :: Type -> Type Flip :: Type -> Type Synonyms -ForConst = forall (a :: Type) (b :: Type). b -> a +ForConst = forall (a :: Type) (b :: Type). (b :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :1 -TripleForall = forall (a :: Type) (b :: Type) (c :: Type). b -> c -> a +TripleForall = forall (a :: Type) (b :: Type) (c :: Type). (b :: Type) -> (c :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :1 -Flip = forall (a :: Type) (b :: Type) (c :: Type). (a -> b -> c) -> b -> a -> c +Flip = forall (a :: Type) (b :: Type) (c :: Type). + ((a :: Type) -> (b :: Type) -> (c :: Type)) -> (b :: Type) -> (a :: Type) -> (c :: Type) Quantified = :0 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/075_inspect_edge_cases/Main.snap b/tests-integration/fixtures/checking/075_inspect_edge_cases/Main.snap index ec23b757..a1e5a5a9 100644 --- a/tests-integration/fixtures/checking/075_inspect_edge_cases/Main.snap +++ b/tests-integration/fixtures/checking/075_inspect_edge_cases/Main.snap @@ -4,11 +4,11 @@ expression: report --- Terms justInt :: Int -notFunction :: forall (a :: Type). a -> Int -deeply :: forall (a :: Type). Level3 a -outer :: forall (a :: Type). a -> a +notFunction :: forall (a :: Type). (a :: Type) -> Int +deeply :: forall (a :: Type). Level3 (a :: Type) +outer :: forall (a :: Type). (a :: Type) -> (a :: Type) parens :: (Int -> Int) -> Int -zeroArg :: forall (a :: Type). a +zeroArg :: forall (a :: Type). (a :: Type) Types JustInt :: Type @@ -41,17 +41,17 @@ Level2 = Int -> Int -> Int Kind = :0 Type = :0 -Level3 = forall (a :: Type). a -> Int -> Int -> Int +Level3 = forall (a :: Type). (a :: Type) -> Int -> Int -> Int Quantified = :0 Kind = :0 Type = :1 -Inner = forall (a :: Type). a -> a +Inner = forall (a :: Type). (a :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :0 -Outer = forall (a :: Type). a -> a +Outer = forall (a :: Type). (a :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :0 diff --git a/tests-integration/fixtures/checking/076_inspect_constraints/Main.snap b/tests-integration/fixtures/checking/076_inspect_constraints/Main.snap index 49472a01..d21b8bf8 100644 --- a/tests-integration/fixtures/checking/076_inspect_constraints/Main.snap +++ b/tests-integration/fixtures/checking/076_inspect_constraints/Main.snap @@ -3,13 +3,15 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String -eq :: forall (a :: Type). Eq a => a -> a -> Boolean -showIt :: forall (a :: Type). Show a => a -> String -compare :: forall (a :: Type). Show a => Eq a => a -> a -> String -showFn :: forall (a :: Type). ShowFunction a -constrainedReturn :: forall (a :: Type). Show a => a -> ReturnsString a -nested :: forall (a :: Type). Eq a => NestedConstraint a +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean +showIt :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String +compare :: + forall (a :: Type). Show (a :: Type) => Eq (a :: Type) => (a :: Type) -> (a :: Type) -> String +showFn :: forall (a :: Type). ShowFunction (a :: Type) +constrainedReturn :: + forall (a :: Type). Show (a :: Type) => (a :: Type) -> ReturnsString (a :: Type) +nested :: forall (a :: Type). Eq (a :: Type) => NestedConstraint (a :: Type) Types Show :: Type -> Constraint @@ -19,17 +21,17 @@ ReturnsString :: Type -> Type NestedConstraint :: Type -> Type Synonyms -ShowFunction = forall (a :: Type). Show a => a -> String +ShowFunction = forall (a :: Type). Show (a :: Type) => (a :: Type) -> String Quantified = :0 Kind = :0 Type = :1 -ReturnsString = forall (a :: Type). a -> String +ReturnsString = forall (a :: Type). (a :: Type) -> String Quantified = :0 Kind = :0 Type = :1 -NestedConstraint = forall (a :: Type) (b :: Type). Show b => a -> b -> String +NestedConstraint = forall (a :: Type) (b :: Type). Show (b :: Type) => (a :: Type) -> (b :: Type) -> String Quantified = :0 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/077_inspect_arity/Main.snap b/tests-integration/fixtures/checking/077_inspect_arity/Main.snap index 3d906dad..99139ca7 100644 --- a/tests-integration/fixtures/checking/077_inspect_arity/Main.snap +++ b/tests-integration/fixtures/checking/077_inspect_arity/Main.snap @@ -1,21 +1,20 @@ --- source: tests-integration/tests/checking/generated.rs -assertion_line: 11 expression: report --- Terms -foo0 :: forall (a :: Type). a -> a -> Int -foo1 :: forall (a :: Type). a -> a -> Int -foo2 :: forall (a :: Type). a -> a -> Int -bar0 :: forall (a :: Type). ReturnsInt a -> ReturnsInt a -bar1 :: forall (a :: Type). ReturnsInt a -> ReturnsInt a -bar2 :: forall (a :: Type). ReturnsInt a -> ReturnsInt a +foo0 :: forall (a :: Type). (a :: Type) -> (a :: Type) -> Int +foo1 :: forall (a :: Type). (a :: Type) -> (a :: Type) -> Int +foo2 :: forall (a :: Type). (a :: Type) -> (a :: Type) -> Int +bar0 :: forall (a :: Type). ReturnsInt (a :: Type) -> ReturnsInt (a :: Type) +bar1 :: forall (a :: Type). ReturnsInt (a :: Type) -> ReturnsInt (a :: Type) +bar2 :: forall (a :: Type). ReturnsInt (a :: Type) -> ReturnsInt (a :: Type) Types ReturnsInt :: Type -> Type Synonyms -ReturnsInt = forall (a :: Type). a -> Int +ReturnsInt = forall (a :: Type). (a :: Type) -> Int Quantified = :0 Kind = :0 Type = :1 diff --git a/tests-integration/fixtures/checking/078_inspect_arity_invalid/Main.snap b/tests-integration/fixtures/checking/078_inspect_arity_invalid/Main.snap index 4042cb24..22969a05 100644 --- a/tests-integration/fixtures/checking/078_inspect_arity_invalid/Main.snap +++ b/tests-integration/fixtures/checking/078_inspect_arity_invalid/Main.snap @@ -1,12 +1,11 @@ --- source: tests-integration/tests/checking/generated.rs -assertion_line: 11 expression: report --- Terms -addWrong :: forall (a :: Type). BinaryOp a -composeWrong :: forall (a :: Type). ReturnUnary a -constWrong :: forall (a :: Type) (b :: Type). a -> b -> a +addWrong :: forall (a :: Type). BinaryOp (a :: Type) +composeWrong :: forall (a :: Type). ReturnUnary (a :: Type) +constWrong :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> (a :: Type) Types BinaryOp :: Type -> Type @@ -15,22 +14,22 @@ ReturnUnary :: Type -> Type Const :: Type Synonyms -BinaryOp = forall (a :: Type). a -> a -> a +BinaryOp = forall (a :: Type). (a :: Type) -> (a :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :1 -UnaryOp = forall (a :: Type). a -> a +UnaryOp = forall (a :: Type). (a :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :1 -ReturnUnary = forall (a :: Type). a -> UnaryOp a +ReturnUnary = forall (a :: Type). (a :: Type) -> UnaryOp (a :: Type) Quantified = :0 Kind = :0 Type = :1 -Const = forall (a :: Type) (b :: Type). a -> b -> a +Const = forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> (a :: Type) Quantified = :0 Kind = :0 Type = :0 diff --git a/tests-integration/fixtures/checking/079_let_recursive/Main.snap b/tests-integration/fixtures/checking/079_let_recursive/Main.snap index 9ee03edb..08dcd492 100644 --- a/tests-integration/fixtures/checking/079_let_recursive/Main.snap +++ b/tests-integration/fixtures/checking/079_let_recursive/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -absurd :: forall (a :: Type). Void -> a +absurd :: forall (a :: Type). Void -> (a :: Type) selfRecursive :: Void -> Int mutualRecursive :: Void -> Int threeWay :: Void -> Int diff --git a/tests-integration/fixtures/checking/080_let_recursive_errors/Main.snap b/tests-integration/fixtures/checking/080_let_recursive_errors/Main.snap index 64e17457..cb4f1672 100644 --- a/tests-integration/fixtures/checking/080_let_recursive_errors/Main.snap +++ b/tests-integration/fixtures/checking/080_let_recursive_errors/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -id :: forall (a :: Type). a -> a +id :: forall (a :: Type). (a :: Type) -> (a :: Type) typeMismatch :: Int -> Int occurCheck :: Int -> Int inferConflict :: Int -> Int diff --git a/tests-integration/fixtures/checking/083_instance_basic/Main.snap b/tests-integration/fixtures/checking/083_instance_basic/Main.snap index b1f67aa7..fe16548c 100644 --- a/tests-integration/fixtures/checking/083_instance_basic/Main.snap +++ b/tests-integration/fixtures/checking/083_instance_basic/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -eq :: forall (a :: Type). Eq a => a -> a -> Boolean +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean Types Eq :: Type -> Constraint @@ -12,5 +12,5 @@ Classes class Eq (&0 :: Type) Instances -instance Eq &0 => Eq (Array &0 :: Type) +instance Eq (&0 :: Type) => Eq (Array (&0 :: Type) :: Type) chain: 0 diff --git a/tests-integration/fixtures/checking/084_instance_eq/Main.snap b/tests-integration/fixtures/checking/084_instance_eq/Main.snap index 895ded76..083c9ca9 100644 --- a/tests-integration/fixtures/checking/084_instance_eq/Main.snap +++ b/tests-integration/fixtures/checking/084_instance_eq/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -eq :: forall (a :: Type). Eq a => a -> a -> Boolean +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean test :: Array Boolean Types diff --git a/tests-integration/fixtures/checking/085_instance_functional_dependency/Main.snap b/tests-integration/fixtures/checking/085_instance_functional_dependency/Main.snap index 19b9c663..3a0e10e7 100644 --- a/tests-integration/fixtures/checking/085_instance_functional_dependency/Main.snap +++ b/tests-integration/fixtures/checking/085_instance_functional_dependency/Main.snap @@ -3,7 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -convert :: forall (a :: Type) (b :: Type). Convert a b => a -> b +convert :: + forall (a :: Type) (b :: Type). Convert (a :: Type) (b :: Type) => (a :: Type) -> (b :: Type) test :: String Types diff --git a/tests-integration/fixtures/checking/086_instance_functional_dependency_transitive/Main.snap b/tests-integration/fixtures/checking/086_instance_functional_dependency_transitive/Main.snap index aa5d08c3..29a2bbe6 100644 --- a/tests-integration/fixtures/checking/086_instance_functional_dependency_transitive/Main.snap +++ b/tests-integration/fixtures/checking/086_instance_functional_dependency_transitive/Main.snap @@ -3,14 +3,16 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -chain :: forall (t1 :: Type) (a :: Type) (b :: t1) (c :: Type). Chain a b c => a -> c +chain :: + forall (t1 :: Type) (a :: Type) (b :: (t1 :: Type)) (c :: Type). + Chain (a :: Type) (b :: (t1 :: Type)) (c :: Type) => (a :: Type) -> (c :: Type) test :: Boolean Types -Chain :: forall (t1 :: Type). Type -> t1 -> Type -> Constraint +Chain :: forall (t1 :: Type). Type -> (t1 :: Type) -> Type -> Constraint Classes -class Chain (&1 :: Type) (&2 :: &0) (&3 :: Type) +class Chain (&1 :: Type) (&2 :: (&0 :: Type)) (&3 :: Type) Instances instance Chain (Int :: Type) (String :: Type) (Boolean :: Type) diff --git a/tests-integration/fixtures/checking/087_instance_functional_dependency_multiple/Main.snap b/tests-integration/fixtures/checking/087_instance_functional_dependency_multiple/Main.snap index f041f4f6..af72085f 100644 --- a/tests-integration/fixtures/checking/087_instance_functional_dependency_multiple/Main.snap +++ b/tests-integration/fixtures/checking/087_instance_functional_dependency_multiple/Main.snap @@ -3,7 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -typeEq :: forall (a :: Type) (b :: Type) (c :: Type). TypeEq a b c => a -> b -> c +typeEq :: + forall (a :: Type) (b :: Type) (c :: Type). + TypeEq (a :: Type) (b :: Type) (c :: Type) => (a :: Type) -> (b :: Type) -> (c :: Type) test :: Boolean Types diff --git a/tests-integration/fixtures/checking/088_given_constraint_matching/Main.snap b/tests-integration/fixtures/checking/088_given_constraint_matching/Main.snap index e98cb00f..58c38874 100644 --- a/tests-integration/fixtures/checking/088_given_constraint_matching/Main.snap +++ b/tests-integration/fixtures/checking/088_given_constraint_matching/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -eq :: forall (a :: Type). Eq a => a -> a -> Boolean -test :: forall (a :: Type). Eq a => a -> Boolean +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean +test :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> Boolean Types Eq :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/089_no_instance_found/Main.snap b/tests-integration/fixtures/checking/089_no_instance_found/Main.snap index c3a35638..9595f74e 100644 --- a/tests-integration/fixtures/checking/089_no_instance_found/Main.snap +++ b/tests-integration/fixtures/checking/089_no_instance_found/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -eq :: forall (a :: Type). Eq a => a -> a -> Boolean +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean Foo :: Foo test :: Foo -> Boolean diff --git a/tests-integration/fixtures/checking/090_instance_improve/Main.snap b/tests-integration/fixtures/checking/090_instance_improve/Main.snap index 843c4db4..56b86cde 100644 --- a/tests-integration/fixtures/checking/090_instance_improve/Main.snap +++ b/tests-integration/fixtures/checking/090_instance_improve/Main.snap @@ -3,13 +3,15 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -identity :: forall (t2 :: Type) (a :: Type) (b :: Type) (r :: t2). TypeEq a b r => a -> b +identity :: + forall (t2 :: Type) (a :: Type) (b :: Type) (r :: (t2 :: Type)). + TypeEq (a :: Type) (b :: Type) (r :: (t2 :: Type)) => (a :: Type) -> (b :: Type) test :: Int Types True :: Type False :: Type -TypeEq :: forall (t2 :: Type). Type -> Type -> t2 -> Constraint +TypeEq :: forall (t2 :: Type). Type -> Type -> (t2 :: Type) -> Constraint Data True @@ -26,8 +28,8 @@ True = [] False = [] Classes -class TypeEq (&1 :: Type) (&2 :: Type) (&3 :: &0) +class TypeEq (&1 :: Type) (&2 :: Type) (&3 :: (&0 :: Type)) Instances -instance TypeEq (&0 :: Type) (&0 :: Type) (True :: Type) +instance TypeEq ((&0 :: Type) :: Type) ((&0 :: Type) :: Type) (True :: Type) chain: 0 diff --git a/tests-integration/fixtures/checking/091_superclass_elaboration/Main.snap b/tests-integration/fixtures/checking/091_superclass_elaboration/Main.snap index b5104d5a..6dea7d9b 100644 --- a/tests-integration/fixtures/checking/091_superclass_elaboration/Main.snap +++ b/tests-integration/fixtures/checking/091_superclass_elaboration/Main.snap @@ -3,13 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -eq :: forall (a :: Type). Eq a => a -> a -> Boolean -compare :: forall (a :: Type). Ord a => a -> a -> Ordering +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean +compare :: forall (a :: Type). Ord (a :: Type) => (a :: Type) -> (a :: Type) -> Ordering LT :: Ordering EQ :: Ordering GT :: Ordering -test :: forall (a :: Type). Ord a => a -> a -> Boolean -test2 :: forall (a :: Type). Ord a => a -> a -> Ordering +test :: forall (a :: Type). Ord (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean +test2 :: forall (a :: Type). Ord (a :: Type) => (a :: Type) -> (a :: Type) -> Ordering Types Eq :: Type -> Constraint @@ -27,4 +27,4 @@ Ordering = [] Classes class Eq (&0 :: Type) -class Eq &0 <= Ord (&0 :: Type) +class Eq (&0 :: Type) <= Ord (&0 :: Type) diff --git a/tests-integration/fixtures/checking/092_ambiguous_constraint/Main.snap b/tests-integration/fixtures/checking/092_ambiguous_constraint/Main.snap index 6e909327..3629ec60 100644 --- a/tests-integration/fixtures/checking/092_ambiguous_constraint/Main.snap +++ b/tests-integration/fixtures/checking/092_ambiguous_constraint/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -read :: forall (a :: Type). Read a => String -> a -show :: forall (a :: Type). Show a => a -> String +read :: forall (a :: Type). Read (a :: Type) => String -> (a :: Type) +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String test :: String -> String Types diff --git a/tests-integration/fixtures/checking/093_constraint_generalization/Main.snap b/tests-integration/fixtures/checking/093_constraint_generalization/Main.snap index 3657b111..c898b941 100644 --- a/tests-integration/fixtures/checking/093_constraint_generalization/Main.snap +++ b/tests-integration/fixtures/checking/093_constraint_generalization/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -eq :: forall (a :: Type). Eq a => a -> a -> Boolean -test :: forall (t6 :: Type). Eq t6 => t6 -> t6 -> Boolean -compare :: forall (a :: Type). Ord a => a -> a -> Int -test2 :: forall (t11 :: Type). Ord t11 => t11 -> t11 -> Int +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean +test :: forall (t6 :: Type). Eq (t6 :: Type) => (t6 :: Type) -> (t6 :: Type) -> Boolean +compare :: forall (a :: Type). Ord (a :: Type) => (a :: Type) -> (a :: Type) -> Int +test2 :: forall (t11 :: Type). Ord (t11 :: Type) => (t11 :: Type) -> (t11 :: Type) -> Int Types Eq :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/094_let_binding_constraint_error/Main.snap b/tests-integration/fixtures/checking/094_let_binding_constraint_error/Main.snap index a9bd2503..a320ac8e 100644 --- a/tests-integration/fixtures/checking/094_let_binding_constraint_error/Main.snap +++ b/tests-integration/fixtures/checking/094_let_binding_constraint_error/Main.snap @@ -4,7 +4,7 @@ expression: report --- Terms Foo :: Foo -eq :: forall (a :: Type). Eq a => a -> a -> Boolean +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean test :: Boolean Types diff --git a/tests-integration/fixtures/checking/095_given_constraint_arityless/Main.snap b/tests-integration/fixtures/checking/095_given_constraint_arityless/Main.snap index 4a1a3d14..babad5c7 100644 --- a/tests-integration/fixtures/checking/095_given_constraint_arityless/Main.snap +++ b/tests-integration/fixtures/checking/095_given_constraint_arityless/Main.snap @@ -3,11 +3,16 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -eq :: forall (a :: Type). Eq a => a -> a -> Boolean -coerce :: forall (a :: Type) (b :: Type). Coercible a b => a -> b -eqSelf :: forall (a :: Type). Eq a => a -> Boolean -eqCoerce :: forall (a :: Type) (b :: Type). Eq a => Coercible a b => a -> b -eqBoth :: forall (a :: Type) (b :: Type). Eq a => Eq b => a -> b -> Boolean +eq :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> (a :: Type) -> Boolean +coerce :: + forall (a :: Type) (b :: Type). Coercible (a :: Type) (b :: Type) => (a :: Type) -> (b :: Type) +eqSelf :: forall (a :: Type). Eq (a :: Type) => (a :: Type) -> Boolean +eqCoerce :: + forall (a :: Type) (b :: Type). + Eq (a :: Type) => Coercible (a :: Type) (b :: Type) => (a :: Type) -> (b :: Type) +eqBoth :: + forall (a :: Type) (b :: Type). + Eq (a :: Type) => Eq (b :: Type) => (a :: Type) -> (b :: Type) -> Boolean Types Eq :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/096_given_functional_dependency/Main.snap b/tests-integration/fixtures/checking/096_given_functional_dependency/Main.snap index 704b0ff4..a4c973e1 100644 --- a/tests-integration/fixtures/checking/096_given_functional_dependency/Main.snap +++ b/tests-integration/fixtures/checking/096_given_functional_dependency/Main.snap @@ -3,10 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -convert :: forall (a :: Type) (b :: Type). Convert a b => a -> b -useGiven :: forall (x :: Type). Convert Int x => x -relate :: forall (a :: Type) (b :: Type) (c :: Type). Relate a b c => a -> b -> c -useRelate :: forall (y :: Type). Relate Int String y => y +convert :: + forall (a :: Type) (b :: Type). Convert (a :: Type) (b :: Type) => (a :: Type) -> (b :: Type) +useGiven :: forall (x :: Type). Convert Int (x :: Type) => (x :: Type) +relate :: + forall (a :: Type) (b :: Type) (c :: Type). + Relate (a :: Type) (b :: Type) (c :: Type) => (a :: Type) -> (b :: Type) -> (c :: Type) +useRelate :: forall (y :: Type). Relate Int String (y :: Type) => (y :: Type) Types Convert :: Type -> Type -> Constraint diff --git a/tests-integration/fixtures/checking/097_instance_chains/Main.snap b/tests-integration/fixtures/checking/097_instance_chains/Main.snap index 58fcb5a0..042b3c31 100644 --- a/tests-integration/fixtures/checking/097_instance_chains/Main.snap +++ b/tests-integration/fixtures/checking/097_instance_chains/Main.snap @@ -3,14 +3,22 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (t0 :: Type) (a :: t0). Proxy @t0 a -testSame :: forall (t10 :: Type) (r :: t10). TypeEq @Type @Type @t10 Int Int r => Proxy @t10 r -testDiff :: forall (t17 :: Type) (r :: t17). TypeEq @Type @Type @t17 Int String r => Proxy @t17 r +Proxy :: forall (t0 :: Type) (a :: (t0 :: Type)). Proxy @(t0 :: Type) (a :: (t0 :: Type)) +testSame :: + forall (t10 :: Type) (r :: (t10 :: Type)). + TypeEq @Type @Type @(t10 :: Type) Int Int (r :: (t10 :: Type)) => + Proxy @(t10 :: Type) (r :: (t10 :: Type)) +testDiff :: + forall (t17 :: Type) (r :: (t17 :: Type)). + TypeEq @Type @Type @(t17 :: Type) Int String (r :: (t17 :: Type)) => + Proxy @(t17 :: Type) (r :: (t17 :: Type)) test :: { testDiff :: Proxy @Boolean False, testSame :: Proxy @Boolean True } Types -Proxy :: forall (t0 :: Type). t0 -> Type -TypeEq :: forall (t1 :: Type) (t2 :: Type) (t3 :: Type). t1 -> t2 -> t3 -> Constraint +Proxy :: forall (t0 :: Type). (t0 :: Type) -> Type +TypeEq :: + forall (t1 :: Type) (t2 :: Type) (t3 :: Type). + (t1 :: Type) -> (t2 :: Type) -> (t3 :: Type) -> Constraint Data Proxy @@ -22,10 +30,10 @@ Roles Proxy = [Phantom] Classes -class TypeEq (&3 :: &0) (&4 :: &1) (&5 :: &2) +class TypeEq (&3 :: (&0 :: Type)) (&4 :: (&1 :: Type)) (&5 :: (&2 :: Type)) Instances -instance forall (&0 :: Type). TypeEq (&1 :: &0) (&1 :: &0) (True :: Boolean) +instance forall (&0 :: Type). TypeEq ((&1 :: (&0 :: Type)) :: (&0 :: Type)) ((&1 :: (&0 :: Type)) :: (&0 :: Type)) (True :: Boolean) chain: 0 -instance forall (&0 :: Type) (&1 :: Type). TypeEq (&2 :: &0) (&3 :: &1) (False :: Boolean) +instance forall (&0 :: Type) (&1 :: Type). TypeEq ((&2 :: (&0 :: Type)) :: (&0 :: Type)) ((&3 :: (&1 :: Type)) :: (&1 :: Type)) (False :: Boolean) chain: 1 diff --git a/tests-integration/fixtures/checking/098_fundep_propagation/Main.snap b/tests-integration/fixtures/checking/098_fundep_propagation/Main.snap index d66b0514..ba03d54d 100644 --- a/tests-integration/fixtures/checking/098_fundep_propagation/Main.snap +++ b/tests-integration/fixtures/checking/098_fundep_propagation/Main.snap @@ -3,18 +3,27 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (t0 :: Type) (a :: t0). Proxy @t0 a +Proxy :: forall (t0 :: Type) (a :: (t0 :: Type)). Proxy @(t0 :: Type) (a :: (t0 :: Type)) test :: - forall (t18 :: Type) (t19 :: Type) (t22 :: Type) (r1 :: t18) (r2 :: t19) (r :: t22). - IsZero @Type @t18 Z r1 => IsZero @Type @t19 Z r2 => And @t18 @t19 @t22 r1 r2 r => Proxy @t22 r + forall (t18 :: Type) (t19 :: Type) (t22 :: Type) (r1 :: (t18 :: Type)) (r2 :: (t19 :: Type)) + (r :: (t22 :: Type)). + IsZero @Type @(t18 :: Type) Z (r1 :: (t18 :: Type)) => + IsZero @Type @(t19 :: Type) Z (r2 :: (t19 :: Type)) => + And @(t18 :: Type) @(t19 :: Type) @(t22 :: Type) + (r1 :: (t18 :: Type)) + (r2 :: (t19 :: Type)) + (r :: (t22 :: Type)) => + Proxy @(t22 :: Type) (r :: (t22 :: Type)) forceSolve :: { test :: Proxy @Boolean True } Types -Proxy :: forall (t0 :: Type). t0 -> Type -IsZero :: forall (t1 :: Type) (t2 :: Type). t1 -> t2 -> Constraint +Proxy :: forall (t0 :: Type). (t0 :: Type) -> Type +IsZero :: forall (t1 :: Type) (t2 :: Type). (t1 :: Type) -> (t2 :: Type) -> Constraint Z :: Type S :: Type -> Type -And :: forall (t3 :: Type) (t4 :: Type) (t5 :: Type). t3 -> t4 -> t5 -> Constraint +And :: + forall (t3 :: Type) (t4 :: Type) (t5 :: Type). + (t3 :: Type) -> (t4 :: Type) -> (t5 :: Type) -> Constraint Data Proxy @@ -28,13 +37,13 @@ Z = [] S = [Nominal] Classes -class IsZero (&2 :: &0) (&3 :: &1) -class And (&3 :: &0) (&4 :: &1) (&5 :: &2) +class IsZero (&2 :: (&0 :: Type)) (&3 :: (&1 :: Type)) +class And (&3 :: (&0 :: Type)) (&4 :: (&1 :: Type)) (&5 :: (&2 :: Type)) Instances instance IsZero (Z :: Type) (True :: Boolean) chain: 0 -instance IsZero (S &0 :: Type) (False :: Boolean) +instance IsZero (S (&0 :: Type) :: Type) (False :: Boolean) chain: 0 instance And (True :: Boolean) (True :: Boolean) (True :: Boolean) chain: 0 diff --git a/tests-integration/fixtures/checking/099_builtin_int/Main.snap b/tests-integration/fixtures/checking/099_builtin_int/Main.snap index 09185331..d9567447 100644 --- a/tests-integration/fixtures/checking/099_builtin_int/Main.snap +++ b/tests-integration/fixtures/checking/099_builtin_int/Main.snap @@ -3,16 +3,19 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) Unit :: Unit -deriveSum :: forall (sum :: Int). Add 1 2 sum => Proxy @Int sum -deriveRight :: forall (right :: Int). Add 1 right 3 => Proxy @Int right -deriveLeft :: forall (left :: Int). Add left 2 3 => Proxy @Int left -deriveMul :: forall (product :: Int). Mul 3 4 product => Proxy @Int product -compareLT :: forall (ord :: Ordering). Compare 1 2 ord => Proxy @Ordering ord -compareEQ :: forall (ord :: Ordering). Compare 5 5 ord => Proxy @Ordering ord -compareGT :: forall (ord :: Ordering). Compare 10 3 ord => Proxy @Ordering ord -deriveString :: forall (s :: Symbol). ToString 42 s => Proxy @Symbol s +deriveSum :: forall (sum :: Int). Add 1 2 (sum :: Int) => Proxy @Int (sum :: Int) +deriveRight :: forall (right :: Int). Add 1 (right :: Int) 3 => Proxy @Int (right :: Int) +deriveLeft :: forall (left :: Int). Add (left :: Int) 2 3 => Proxy @Int (left :: Int) +deriveMul :: forall (product :: Int). Mul 3 4 (product :: Int) => Proxy @Int (product :: Int) +compareLT :: + forall (ord :: Ordering). Compare 1 2 (ord :: Ordering) => Proxy @Ordering (ord :: Ordering) +compareEQ :: + forall (ord :: Ordering). Compare 5 5 (ord :: Ordering) => Proxy @Ordering (ord :: Ordering) +compareGT :: + forall (ord :: Ordering). Compare 10 3 (ord :: Ordering) => Proxy @Ordering (ord :: Ordering) +deriveString :: forall (s :: Symbol). ToString 42 (s :: Symbol) => Proxy @Symbol (s :: Symbol) forceSolve :: { compareEQ :: Proxy @Ordering EQ , compareGT :: Proxy @Ordering GT @@ -25,7 +28,7 @@ forceSolve :: } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Unit :: Type Data diff --git a/tests-integration/fixtures/checking/100_builtin_given/Main.snap b/tests-integration/fixtures/checking/100_builtin_given/Main.snap index 30feedcf..db2d4120 100644 --- a/tests-integration/fixtures/checking/100_builtin_given/Main.snap +++ b/tests-integration/fixtures/checking/100_builtin_given/Main.snap @@ -3,27 +3,27 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) N :: N mkN :: forall (i :: Int) (lower :: Int) (upper :: Int). - Add 1 (-1) lower => - Compare i lower GT => - Add 5 1 upper => - Compare i upper LT => - Proxy @Int i -> N + Add 1 (-1) (lower :: Int) => + Compare (i :: Int) (lower :: Int) GT => + Add 5 1 (upper :: Int) => + Compare (i :: Int) (upper :: Int) LT => + Proxy @Int (i :: Int) -> N Something :: N -> Something mkSomething :: forall (i :: Int) (lower :: Int) (upper :: Int). - Add 1 (-1) lower => - Compare i lower GT => - Add 5 1 upper => - Compare i upper LT => - Proxy @Int i -> Something + Add 1 (-1) (lower :: Int) => + Compare (i :: Int) (lower :: Int) GT => + Add 5 1 (upper :: Int) => + Compare (i :: Int) (upper :: Int) LT => + Proxy @Int (i :: Int) -> Something forceSolve :: Something Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type N :: Type MinN :: Int MaxN :: Int diff --git a/tests-integration/fixtures/checking/101_builtin_symbol/Main.snap b/tests-integration/fixtures/checking/101_builtin_symbol/Main.snap index f7cd5b11..8482ca39 100644 --- a/tests-integration/fixtures/checking/101_builtin_symbol/Main.snap +++ b/tests-integration/fixtures/checking/101_builtin_symbol/Main.snap @@ -3,22 +3,40 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) deriveAppended :: - forall (appended :: Symbol). Append "Hello" "World" appended => Proxy @Symbol appended -deriveLeft :: forall (left :: Symbol). Append left "World" "HelloWorld" => Proxy @Symbol left -deriveRight :: forall (right :: Symbol). Append "Hello" right "HelloWorld" => Proxy @Symbol right -appendEmpty :: forall (result :: Symbol). Append "" "test" result => Proxy @Symbol result -appendEmptyRight :: forall (result :: Symbol). Append "test" "" result => Proxy @Symbol result -compareLT :: forall (ord :: Ordering). Compare "a" "b" ord => Proxy @Ordering ord -compareEQ :: forall (ord :: Ordering). Compare "hello" "hello" ord => Proxy @Ordering ord -compareGT :: forall (ord :: Ordering). Compare "z" "a" ord => Proxy @Ordering ord -comparePrefix :: forall (ord :: Ordering). Compare "ab" "abc" ord => Proxy @Ordering ord -deriveCons :: forall (symbol :: Symbol). Cons "H" "ello" symbol => Proxy @Symbol symbol + forall (appended :: Symbol). + Append "Hello" "World" (appended :: Symbol) => Proxy @Symbol (appended :: Symbol) +deriveLeft :: + forall (left :: Symbol). + Append (left :: Symbol) "World" "HelloWorld" => Proxy @Symbol (left :: Symbol) +deriveRight :: + forall (right :: Symbol). + Append "Hello" (right :: Symbol) "HelloWorld" => Proxy @Symbol (right :: Symbol) +appendEmpty :: + forall (result :: Symbol). Append "" "test" (result :: Symbol) => Proxy @Symbol (result :: Symbol) +appendEmptyRight :: + forall (result :: Symbol). Append "test" "" (result :: Symbol) => Proxy @Symbol (result :: Symbol) +compareLT :: + forall (ord :: Ordering). Compare "a" "b" (ord :: Ordering) => Proxy @Ordering (ord :: Ordering) +compareEQ :: + forall (ord :: Ordering). + Compare "hello" "hello" (ord :: Ordering) => Proxy @Ordering (ord :: Ordering) +compareGT :: + forall (ord :: Ordering). Compare "z" "a" (ord :: Ordering) => Proxy @Ordering (ord :: Ordering) +comparePrefix :: + forall (ord :: Ordering). + Compare "ab" "abc" (ord :: Ordering) => Proxy @Ordering (ord :: Ordering) +deriveCons :: + forall (symbol :: Symbol). Cons "H" "ello" (symbol :: Symbol) => Proxy @Symbol (symbol :: Symbol) deriveHeadTail :: - forall (head :: Symbol) (tail :: Symbol). Cons head tail "World" => Proxy @Symbol head -consEmptyTail :: forall (symbol :: Symbol). Cons "X" "" symbol => Proxy @Symbol symbol -consSingleChar :: forall (head :: Symbol) (tail :: Symbol). Cons head tail "A" => Proxy @Symbol tail + forall (head :: Symbol) (tail :: Symbol). + Cons (head :: Symbol) (tail :: Symbol) "World" => Proxy @Symbol (head :: Symbol) +consEmptyTail :: + forall (symbol :: Symbol). Cons "X" "" (symbol :: Symbol) => Proxy @Symbol (symbol :: Symbol) +consSingleChar :: + forall (head :: Symbol) (tail :: Symbol). + Cons (head :: Symbol) (tail :: Symbol) "A" => Proxy @Symbol (tail :: Symbol) forceSolve :: { appendEmpty :: Proxy @Symbol "test" , appendEmptyRight :: Proxy @Symbol "test" @@ -36,7 +54,7 @@ forceSolve :: } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/102_builtin_row/Main.snap b/tests-integration/fixtures/checking/102_builtin_row/Main.snap index 23687cf1..196bd1b9 100644 --- a/tests-integration/fixtures/checking/102_builtin_row/Main.snap +++ b/tests-integration/fixtures/checking/102_builtin_row/Main.snap @@ -3,54 +3,82 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) deriveUnion :: - forall (u :: Row Type). Union @Type ( a :: Int ) ( b :: String ) u => Proxy @(Row Type) u + forall (u :: Row Type). + Union @Type ( a :: Int ) ( b :: String ) (u :: Row Type) => Proxy @(Row Type) (u :: Row Type) deriveUnionLeft :: forall (l :: Row Type). - Union @Type l ( b :: String ) ( a :: Int, b :: String ) => Proxy @(Row Type) l + Union @Type (l :: Row Type) ( b :: String ) ( a :: Int, b :: String ) => + Proxy @(Row Type) (l :: Row Type) deriveUnionRight :: forall (r :: Row Type). - Union @Type ( a :: Int ) r ( a :: Int, b :: String ) => Proxy @(Row Type) r -unionEmptyLeft :: forall (u :: Row Type). Union @Type () ( a :: Int ) u => Proxy @(Row Type) u -unionEmptyRight :: forall (u :: Row Type). Union @Type ( a :: Int ) () u => Proxy @(Row Type) u -unionBothEmpty :: forall (t31 :: Type) (u :: Row t31). Union @t31 () () u => Proxy @(Row t31) u + Union @Type ( a :: Int ) (r :: Row Type) ( a :: Int, b :: String ) => + Proxy @(Row Type) (r :: Row Type) +unionEmptyLeft :: + forall (u :: Row Type). + Union @Type () ( a :: Int ) (u :: Row Type) => Proxy @(Row Type) (u :: Row Type) +unionEmptyRight :: + forall (u :: Row Type). + Union @Type ( a :: Int ) () (u :: Row Type) => Proxy @(Row Type) (u :: Row Type) +unionBothEmpty :: + forall (t31 :: Type) (u :: Row (t31 :: Type)). + Union @(t31 :: Type) () () (u :: Row (t31 :: Type)) => + Proxy @(Row (t31 :: Type)) (u :: Row (t31 :: Type)) unionMultiple :: forall (u :: Row Type). - Union @Type ( a :: Int, b :: String ) ( c :: Boolean ) u => Proxy @(Row Type) u -deriveCons :: forall (row :: Row Type). Cons @Type "name" String () row => Proxy @(Row Type) row + Union @Type ( a :: Int, b :: String ) ( c :: Boolean ) (u :: Row Type) => + Proxy @(Row Type) (u :: Row Type) +deriveCons :: + forall (row :: Row Type). + Cons @Type "name" String () (row :: Row Type) => Proxy @(Row Type) (row :: Row Type) deriveTail :: forall (tail :: Row Type). - Cons @Type "name" String tail ( age :: Int, name :: String ) => Proxy @(Row Type) tail -deriveType :: forall (t :: Type). Cons @Type "name" t () ( name :: String ) => Proxy @Type t + Cons @Type "name" String (tail :: Row Type) ( age :: Int, name :: String ) => + Proxy @(Row Type) (tail :: Row Type) +deriveType :: + forall (t :: Type). Cons @Type "name" (t :: Type) () ( name :: String ) => Proxy @Type (t :: Type) nestedCons :: - forall (row :: Row Type). Cons @Type "a" Int ( b :: String ) row => Proxy @(Row Type) row + forall (row :: Row Type). + Cons @Type "a" Int ( b :: String ) (row :: Row Type) => Proxy @(Row Type) (row :: Row Type) lacksSimple :: - forall (t62 :: Type) (r :: t62). - Lacks @Type "missing" ( a :: Int, b :: String ) => Proxy @t62 r -> Proxy @t62 r + forall (t62 :: Type) (r :: (t62 :: Type)). + Lacks @Type "missing" ( a :: Int, b :: String ) => + Proxy @(t62 :: Type) (r :: (t62 :: Type)) -> Proxy @(t62 :: Type) (r :: (t62 :: Type)) lacksEmpty :: - forall (t69 :: Type) (t64 :: Type) (r :: t69). - Lacks @t64 "anything" () => Proxy @t69 r -> Proxy @t69 r + forall (t69 :: Type) (t64 :: Type) (r :: (t69 :: Type)). + Lacks @(t64 :: Type) "anything" () => + Proxy @(t69 :: Type) (r :: (t69 :: Type)) -> Proxy @(t69 :: Type) (r :: (t69 :: Type)) nubNoDuplicates :: forall (nubbed :: Row Type). - Nub @Type ( a :: Int, b :: String ) nubbed => Proxy @(Row Type) nubbed -nubEmpty :: forall (t77 :: Type) (nubbed :: Row t77). Nub @t77 () nubbed => Proxy @(Row t77) nubbed + Nub @Type ( a :: Int, b :: String ) (nubbed :: Row Type) => + Proxy @(Row Type) (nubbed :: Row Type) +nubEmpty :: + forall (t77 :: Type) (nubbed :: Row (t77 :: Type)). + Nub @(t77 :: Type) () (nubbed :: Row (t77 :: Type)) => + Proxy @(Row (t77 :: Type)) (nubbed :: Row (t77 :: Type)) rowToListSimple :: - forall (list :: RowList Type). RowToList @Type ( a :: Int ) list => Proxy @(RowList Type) list + forall (list :: RowList Type). + RowToList @Type ( a :: Int ) (list :: RowList Type) => + Proxy @(RowList Type) (list :: RowList Type) rowToListMultiple :: forall (list :: RowList Type). - RowToList @Type ( a :: Int, b :: String ) list => Proxy @(RowList Type) list + RowToList @Type ( a :: Int, b :: String ) (list :: RowList Type) => + Proxy @(RowList Type) (list :: RowList Type) rowToListEmpty :: - forall (t90 :: Type) (list :: RowList t90). RowToList @t90 () list => Proxy @(RowList t90) list + forall (t90 :: Type) (list :: RowList (t90 :: Type)). + RowToList @(t90 :: Type) () (list :: RowList (t90 :: Type)) => + Proxy @(RowList (t90 :: Type)) (list :: RowList (t90 :: Type)) rowToListThree :: forall (list :: RowList Type). - RowToList @Type ( a :: Int, b :: String, c :: Boolean ) list => Proxy @(RowList Type) list + RowToList @Type ( a :: Int, b :: String, c :: Boolean ) (list :: RowList Type) => + Proxy @(RowList Type) (list :: RowList Type) solveUnion :: forall (t147 :: Type). { deriveUnion :: Proxy @(Row Type) ( a :: Int, b :: String ) , deriveUnionLeft :: Proxy @(Row Type) ( a :: Int ) , deriveUnionRight :: Proxy @(Row Type) ( b :: String ) - , unionBothEmpty :: Proxy @(Row t147) () + , unionBothEmpty :: Proxy @(Row (t147 :: Type)) () , unionEmptyLeft :: Proxy @(Row Type) ( a :: Int ) , unionEmptyRight :: Proxy @(Row Type) ( a :: Int ) , unionMultiple :: Proxy @(Row Type) ( a :: Int, b :: String, c :: Boolean ) @@ -62,16 +90,18 @@ solveCons :: , nestedCons :: Proxy @(Row Type) ( a :: Int, b :: String ) } solveLacks :: - forall (t160 :: Type) (t161 :: t160) (t164 :: Type) (t166 :: t164). - { lacksEmpty :: Proxy @t164 t166, lacksSimple :: Proxy @t160 t161 } + forall (t160 :: Type) (t161 :: (t160 :: Type)) (t164 :: Type) (t166 :: (t164 :: Type)). + { lacksEmpty :: Proxy @(t164 :: Type) (t166 :: ???) + , lacksSimple :: Proxy @(t160 :: Type) (t161 :: ???) + } solveNub :: forall (t175 :: Type). - { nubEmpty :: Proxy @(Row t175) () + { nubEmpty :: Proxy @(Row (t175 :: Type)) () , nubNoDuplicates :: Proxy @(Row Type) ( a :: Int, b :: String ) } solveRowToList :: forall (t183 :: Type). - { rowToListEmpty :: Proxy @(RowList t183) (Nil @t183) + { rowToListEmpty :: Proxy @(RowList (t183 :: Type)) (Nil @(t183 :: Type)) , rowToListMultiple :: Proxy @(RowList Type) (Cons @Type "a" Int (Cons @Type "b" String (Nil @Type))) , rowToListSimple :: Proxy @(RowList Type) (Cons @Type "a" Int (Nil @Type)) @@ -81,7 +111,7 @@ solveRowToList :: } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/103_do_row_collector/Main.snap b/tests-integration/fixtures/checking/103_do_row_collector/Main.snap index 1f142c7d..6308ae79 100644 --- a/tests-integration/fixtures/checking/103_do_row_collector/Main.snap +++ b/tests-integration/fixtures/checking/103_do_row_collector/Main.snap @@ -6,22 +6,26 @@ Terms bind :: forall (countL :: Int) (countR :: Int) (countLR :: Int) (countOut :: Int) (fieldNum :: Symbol) (fieldName :: Symbol) (a :: Type) (b :: Type) (r :: Row Type) (r' :: Row Type) (s :: Row Type). - Add countL countR countLR => - Add countLR 1 countOut => - ToString countOut fieldNum => - Append "_" fieldNum fieldName => - Cons @Type fieldName a r r' => - Collector countL s a -> (a -> Collector countR r b) -> Collector countOut r' b + Add (countL :: Int) (countR :: Int) (countLR :: Int) => + Add (countLR :: Int) 1 (countOut :: Int) => + ToString (countOut :: Int) (fieldNum :: Symbol) => + Append "_" (fieldNum :: Symbol) (fieldName :: Symbol) => + Cons @Type (fieldName :: Symbol) (a :: Type) (r :: Row Type) (r' :: Row Type) => + Collector (countL :: Int) (s :: Row Type) (a :: Type) -> + ((a :: Type) -> Collector (countR :: Int) (r :: Row Type) (b :: Type)) -> + Collector (countOut :: Int) (r' :: Row Type) (b :: Type) discard :: forall (countL :: Int) (countR :: Int) (countLR :: Int) (countOut :: Int) (fieldNum :: Symbol) (fieldName :: Symbol) (a :: Type) (b :: Type) (r :: Row Type) (r' :: Row Type) (s :: Row Type). - Add countL countR countLR => - Add countLR 1 countOut => - ToString countOut fieldNum => - Append "_" fieldNum fieldName => - Cons @Type fieldName a r r' => - Collector countL s a -> (a -> Collector countR r b) -> Collector countOut r' b -pure :: forall (a :: Type). a -> Collector 0 () a + Add (countL :: Int) (countR :: Int) (countLR :: Int) => + Add (countLR :: Int) 1 (countOut :: Int) => + ToString (countOut :: Int) (fieldNum :: Symbol) => + Append "_" (fieldNum :: Symbol) (fieldName :: Symbol) => + Cons @Type (fieldName :: Symbol) (a :: Type) (r :: Row Type) (r' :: Row Type) => + Collector (countL :: Int) (s :: Row Type) (a :: Type) -> + ((a :: Type) -> Collector (countR :: Int) (r :: Row Type) (b :: Type)) -> + Collector (countOut :: Int) (r' :: Row Type) (b :: Type) +pure :: forall (a :: Type). (a :: Type) -> Collector 0 () (a :: Type) test1 :: Collector 3 ( _1 :: Char, _2 :: String, _3 :: Int ) { x :: Int, y :: String, z :: Char } test2 :: Collector 2 ( _1 :: Boolean, _2 :: Char ) { x :: Char, y :: Boolean } test3 :: Collector 2 ( _1 :: String, _2 :: Int ) { y :: Int, z :: String } diff --git a/tests-integration/fixtures/checking/106_row_union_invalid_discharged/Main.snap b/tests-integration/fixtures/checking/106_row_union_invalid_discharged/Main.snap index 628c72b7..16f36211 100644 --- a/tests-integration/fixtures/checking/106_row_union_invalid_discharged/Main.snap +++ b/tests-integration/fixtures/checking/106_row_union_invalid_discharged/Main.snap @@ -3,16 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) invalid :: forall (l :: Row Type). - Union @Type l ( b :: String ) ( a :: Int, b :: Int ) => Proxy @(Row Type) l + Union @Type (l :: Row Type) ( b :: String ) ( a :: Int, b :: Int ) => + Proxy @(Row Type) (l :: Row Type) forceSolve :: forall (t11 :: Row Type). - Union @Type t11 ( b :: String ) ( a :: Int, b :: Int ) => { invalid :: Proxy @(Row Type) t11 } + Union @Type (t11 :: Row Type) ( b :: String ) ( a :: Int, b :: Int ) => + { invalid :: Proxy @(Row Type) (t11 :: Row Type) } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/107_symbol_append_invalid_discharged/Main.snap b/tests-integration/fixtures/checking/107_symbol_append_invalid_discharged/Main.snap index 25a45996..d096c8ee 100644 --- a/tests-integration/fixtures/checking/107_symbol_append_invalid_discharged/Main.snap +++ b/tests-integration/fixtures/checking/107_symbol_append_invalid_discharged/Main.snap @@ -3,12 +3,14 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a -invalid :: forall (s :: Symbol). Append "hello" s "xyz" => Proxy @Symbol s -forceSolve :: forall (t7 :: Symbol). Append "hello" t7 "xyz" => { invalid :: Proxy @Symbol t7 } +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) +invalid :: forall (s :: Symbol). Append "hello" (s :: Symbol) "xyz" => Proxy @Symbol (s :: Symbol) +forceSolve :: + forall (t7 :: Symbol). + Append "hello" (t7 :: Symbol) "xyz" => { invalid :: Proxy @Symbol (t7 :: Symbol) } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/108_symbol_cons_invalid_discharged/Main.snap b/tests-integration/fixtures/checking/108_symbol_cons_invalid_discharged/Main.snap index 46cf0cce..ac38216e 100644 --- a/tests-integration/fixtures/checking/108_symbol_cons_invalid_discharged/Main.snap +++ b/tests-integration/fixtures/checking/108_symbol_cons_invalid_discharged/Main.snap @@ -3,12 +3,15 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a -invalid :: forall (t :: Symbol). Cons "hello" t "helloworld" => Proxy @Symbol t -forceSolve :: forall (t7 :: Symbol). Cons "hello" t7 "helloworld" => { invalid :: Proxy @Symbol t7 } +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) +invalid :: + forall (t :: Symbol). Cons "hello" (t :: Symbol) "helloworld" => Proxy @Symbol (t :: Symbol) +forceSolve :: + forall (t7 :: Symbol). + Cons "hello" (t7 :: Symbol) "helloworld" => { invalid :: Proxy @Symbol (t7 :: Symbol) } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/109_row_cons_invalid_discharged/Main.snap b/tests-integration/fixtures/checking/109_row_cons_invalid_discharged/Main.snap index 97513cdd..9c37179b 100644 --- a/tests-integration/fixtures/checking/109_row_cons_invalid_discharged/Main.snap +++ b/tests-integration/fixtures/checking/109_row_cons_invalid_discharged/Main.snap @@ -3,16 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) invalid :: forall (t :: Row Type). - Cons @Type "missing" Int t ( a :: Int, b :: String ) => Proxy @(Row Type) t + Cons @Type "missing" Int (t :: Row Type) ( a :: Int, b :: String ) => + Proxy @(Row Type) (t :: Row Type) forceSolve :: forall (t9 :: Row Type). - Cons @Type "missing" Int t9 ( a :: Int, b :: String ) => { invalid :: Proxy @(Row Type) t9 } + Cons @Type "missing" Int (t9 :: Row Type) ( a :: Int, b :: String ) => + { invalid :: Proxy @(Row Type) (t9 :: Row Type) } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/110_row_lacks_invalid_no_instance/Main.snap b/tests-integration/fixtures/checking/110_row_lacks_invalid_no_instance/Main.snap index 535aa9c4..d4097d77 100644 --- a/tests-integration/fixtures/checking/110_row_lacks_invalid_no_instance/Main.snap +++ b/tests-integration/fixtures/checking/110_row_lacks_invalid_no_instance/Main.snap @@ -3,12 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) invalid :: Lacks @Type "b" ( a :: Int, b :: String ) => Proxy @(Row Type) ( a :: Int, b :: String ) forceSolve :: { invalid :: Proxy @(Row Type) ( a :: Int, b :: String ) } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/111_int_add_invalid_no_instance/Main.snap b/tests-integration/fixtures/checking/111_int_add_invalid_no_instance/Main.snap index 87a06f58..8889cc1b 100644 --- a/tests-integration/fixtures/checking/111_int_add_invalid_no_instance/Main.snap +++ b/tests-integration/fixtures/checking/111_int_add_invalid_no_instance/Main.snap @@ -3,12 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) invalid :: Add 2 3 10 => Proxy @Int 10 forceSolve :: { invalid :: Proxy @Int 10 } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/112_int_mul_invalid_no_instance/Main.snap b/tests-integration/fixtures/checking/112_int_mul_invalid_no_instance/Main.snap index 266be6b4..ac88bd4d 100644 --- a/tests-integration/fixtures/checking/112_int_mul_invalid_no_instance/Main.snap +++ b/tests-integration/fixtures/checking/112_int_mul_invalid_no_instance/Main.snap @@ -3,12 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) invalid :: Mul 2 3 10 => Proxy @Int 10 forceSolve :: { invalid :: Proxy @Int 10 } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/113_int_compare_invalid_no_instance/Main.snap b/tests-integration/fixtures/checking/113_int_compare_invalid_no_instance/Main.snap index 54602c05..137d5fb7 100644 --- a/tests-integration/fixtures/checking/113_int_compare_invalid_no_instance/Main.snap +++ b/tests-integration/fixtures/checking/113_int_compare_invalid_no_instance/Main.snap @@ -3,12 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) invalid :: Compare 5 1 LT => Proxy @Ordering LT forceSolve :: { invalid :: Proxy @Ordering LT } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/114_int_tostring_invalid_no_instance/Main.snap b/tests-integration/fixtures/checking/114_int_tostring_invalid_no_instance/Main.snap index 4ecd5fd5..da18ef47 100644 --- a/tests-integration/fixtures/checking/114_int_tostring_invalid_no_instance/Main.snap +++ b/tests-integration/fixtures/checking/114_int_tostring_invalid_no_instance/Main.snap @@ -3,12 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) invalid :: ToString 42 "999" => Proxy @Symbol "999" forceSolve :: { invalid :: Proxy @Symbol "999" } Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/115_empty_do_block/Main.snap b/tests-integration/fixtures/checking/115_empty_do_block/Main.snap index 5054f09d..7eb99fbf 100644 --- a/tests-integration/fixtures/checking/115_empty_do_block/Main.snap +++ b/tests-integration/fixtures/checking/115_empty_do_block/Main.snap @@ -3,9 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -pure :: forall (a :: Type). a -> Effect a -bind :: forall (a :: Type) (b :: Type). Effect a -> (a -> Effect b) -> Effect b -discard :: forall (a :: Type) (b :: Type). Effect a -> (a -> Effect b) -> Effect b +pure :: forall (a :: Type). (a :: Type) -> Effect (a :: Type) +bind :: + forall (a :: Type) (b :: Type). + Effect (a :: Type) -> ((a :: Type) -> Effect (b :: Type)) -> Effect (b :: Type) +discard :: + forall (a :: Type) (b :: Type). + Effect (a :: Type) -> ((a :: Type) -> Effect (b :: Type)) -> Effect (b :: Type) test :: ??? Types diff --git a/tests-integration/fixtures/checking/116_empty_ado_block/Main.snap b/tests-integration/fixtures/checking/116_empty_ado_block/Main.snap index cc52924a..4b2279dc 100644 --- a/tests-integration/fixtures/checking/116_empty_ado_block/Main.snap +++ b/tests-integration/fixtures/checking/116_empty_ado_block/Main.snap @@ -3,9 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -pure :: forall (a :: Type). a -> Effect a -map :: forall (a :: Type) (b :: Type). (a -> b) -> Effect a -> Effect b -apply :: forall (a :: Type) (b :: Type). Effect (a -> b) -> Effect a -> Effect b +pure :: forall (a :: Type). (a :: Type) -> Effect (a :: Type) +map :: + forall (a :: Type) (b :: Type). + ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) +apply :: + forall (a :: Type) (b :: Type). + Effect ((a :: Type) -> (b :: Type)) -> Effect (a :: Type) -> Effect (b :: Type) test1 :: ??? test2 :: Effect Int diff --git a/tests-integration/fixtures/checking/117_do_ado_constrained/Main.snap b/tests-integration/fixtures/checking/117_do_ado_constrained/Main.snap index f3297232..5c8227e0 100644 --- a/tests-integration/fixtures/checking/117_do_ado_constrained/Main.snap +++ b/tests-integration/fixtures/checking/117_do_ado_constrained/Main.snap @@ -3,18 +3,48 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -map :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Functor f => (a -> b) -> f a -> f b -apply :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Apply f => f (a -> b) -> f a -> f b -pure :: forall (f :: Type -> Type) (a :: Type). Applicative f => a -> f a -discard :: forall (m :: Type -> Type) (a :: Type) (b :: Type). Discard m => m a -> (a -> m b) -> m b -bind :: forall (m :: Type -> Type) (a :: Type) (b :: Type). Bind m => m a -> (a -> m b) -> m b -testDo :: forall (m :: Type -> Type). Monad m => m (Tuple Int String) -testDo' :: forall (t55 :: Type -> Type). Bind t55 => t55 (Tuple Int String) -testAdo :: forall (f :: Type -> Type). Applicative f => f (Tuple Int String) -testAdo' :: forall (t85 :: Type -> Type). Applicative t85 => t85 (Tuple Int String) -testDoDiscard :: forall (m :: Type -> Type). Monad m => m Int -testDoDiscard' :: forall (t101 :: Type -> Type). Discard t101 => t101 Int +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +map :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Functor (f :: Type -> Type) => + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +apply :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Apply (f :: Type -> Type) => + (f :: Type -> Type) ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +pure :: + forall (f :: Type -> Type) (a :: Type). + Applicative (f :: Type -> Type) => (a :: Type) -> (f :: Type -> Type) (a :: Type) +discard :: + forall (m :: Type -> Type) (a :: Type) (b :: Type). + Discard (m :: Type -> Type) => + (m :: Type -> Type) (a :: Type) -> + ((a :: Type) -> (m :: Type -> Type) (b :: Type)) -> + (m :: Type -> Type) (b :: Type) +bind :: + forall (m :: Type -> Type) (a :: Type) (b :: Type). + Bind (m :: Type -> Type) => + (m :: Type -> Type) (a :: Type) -> + ((a :: Type) -> (m :: Type -> Type) (b :: Type)) -> + (m :: Type -> Type) (b :: Type) +testDo :: + forall (m :: Type -> Type). Monad (m :: Type -> Type) => (m :: Type -> Type) (Tuple Int String) +testDo' :: + forall (t55 :: Type -> Type). + Bind (t55 :: Type -> Type) => (t55 :: Type -> Type) (Tuple Int String) +testAdo :: + forall (f :: Type -> Type). + Applicative (f :: Type -> Type) => (f :: Type -> Type) (Tuple Int String) +testAdo' :: + forall (t85 :: Type -> Type). + Applicative (t85 :: Type -> Type) => (t85 :: Type -> Type) (Tuple Int String) +testDoDiscard :: forall (m :: Type -> Type). Monad (m :: Type -> Type) => (m :: Type -> Type) Int +testDoDiscard' :: + forall (t101 :: Type -> Type). Discard (t101 :: Type -> Type) => (t101 :: Type -> Type) Int Types Tuple :: Type -> Type -> Type @@ -36,11 +66,11 @@ Tuple = [Representational, Representational] Classes class Functor (&0 :: Type -> Type) -class Functor &0 <= Apply (&0 :: Type -> Type) -class Apply &0 <= Applicative (&0 :: Type -> Type) -class Applicative &0 <= Discard (&0 :: Type -> Type) -class Applicative &0 <= Bind (&0 :: Type -> Type) -class Bind &0 <= Monad (&0 :: Type -> Type) +class Functor (&0 :: Type -> Type) <= Apply (&0 :: Type -> Type) +class Apply (&0 :: Type -> Type) <= Applicative (&0 :: Type -> Type) +class Applicative (&0 :: Type -> Type) <= Discard (&0 :: Type -> Type) +class Applicative (&0 :: Type -> Type) <= Bind (&0 :: Type -> Type) +class Bind (&0 :: Type -> Type) <= Monad (&0 :: Type -> Type) Errors -NoInstanceFound { Discard &0 } at [TermDeclaration(Idx::(10))] +NoInstanceFound { Discard (&0 :: Type -> Type) } at [TermDeclaration(Idx::(10))] diff --git a/tests-integration/fixtures/checking/118_instance_member_type_match/Main.snap b/tests-integration/fixtures/checking/118_instance_member_type_match/Main.snap index 62c9da09..196c0477 100644 --- a/tests-integration/fixtures/checking/118_instance_member_type_match/Main.snap +++ b/tests-integration/fixtures/checking/118_instance_member_type_match/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String Types Show :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/119_instance_member_type_mismatch/Main.snap b/tests-integration/fixtures/checking/119_instance_member_type_mismatch/Main.snap index 480170c4..52e71db9 100644 --- a/tests-integration/fixtures/checking/119_instance_member_type_mismatch/Main.snap +++ b/tests-integration/fixtures/checking/119_instance_member_type_mismatch/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String Types Show :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/120_class_explicit_kind_variable/Main.snap b/tests-integration/fixtures/checking/120_class_explicit_kind_variable/Main.snap index 751b0aa1..804860aa 100644 --- a/tests-integration/fixtures/checking/120_class_explicit_kind_variable/Main.snap +++ b/tests-integration/fixtures/checking/120_class_explicit_kind_variable/Main.snap @@ -3,13 +3,15 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -identity :: forall (k :: Type) (a :: Type) (b :: Type) (r :: k). TypeEq a b r => a -> b +identity :: + forall (k :: Type) (a :: Type) (b :: Type) (r :: (k :: Type)). + TypeEq (a :: Type) (b :: Type) (r :: (k :: Type)) => (a :: Type) -> (b :: Type) Types -TypeEq :: forall (k :: Type). Type -> Type -> k -> Constraint +TypeEq :: forall (k :: Type). Type -> Type -> (k :: Type) -> Constraint Classes -class TypeEq (&1 :: Type) (&2 :: Type) (&3 :: &0) +class TypeEq (&1 :: Type) (&2 :: Type) (&3 :: (&0 :: Type)) Instances instance TypeEq (Int :: Type) (Int :: Type) (Int :: Type) diff --git a/tests-integration/fixtures/checking/121_instance_member_inner_forall/Main.snap b/tests-integration/fixtures/checking/121_instance_member_inner_forall/Main.snap index 418554e0..7aeae948 100644 --- a/tests-integration/fixtures/checking/121_instance_member_inner_forall/Main.snap +++ b/tests-integration/fixtures/checking/121_instance_member_inner_forall/Main.snap @@ -3,8 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -map :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Functor f => (a -> b) -> f a -> f b -Box :: forall (a :: Type). a -> Box a +map :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Functor (f :: Type -> Type) => + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +Box :: forall (a :: Type). (a :: Type) -> Box (a :: Type) Types Functor :: (Type -> Type) -> Constraint diff --git a/tests-integration/fixtures/checking/122_instance_member_inner_forall_constraint/Main.snap b/tests-integration/fixtures/checking/122_instance_member_inner_forall_constraint/Main.snap index 13cd0b89..8da20ce0 100644 --- a/tests-integration/fixtures/checking/122_instance_member_inner_forall_constraint/Main.snap +++ b/tests-integration/fixtures/checking/122_instance_member_inner_forall_constraint/Main.snap @@ -3,12 +3,17 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String map :: - forall (f :: Type -> Type) (a :: Type) (b :: Type). Functor f => Show a => (a -> b) -> f a -> f b -Box :: forall (a :: Type). a -> Box a -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Functor (f :: Type -> Type) => + Show (a :: Type) => + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +Box :: forall (a :: Type). (a :: Type) -> Box (a :: Type) +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) Types Show :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/123_incomplete_instance_head/Main.snap b/tests-integration/fixtures/checking/123_incomplete_instance_head/Main.snap index 48c1a0f4..e4fd1f86 100644 --- a/tests-integration/fixtures/checking/123_incomplete_instance_head/Main.snap +++ b/tests-integration/fixtures/checking/123_incomplete_instance_head/Main.snap @@ -3,7 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -pair :: forall (a :: Type) (b :: Type). Pair a b => a -> b -> { a :: a, b :: b } +pair :: + forall (a :: Type) (b :: Type). + Pair (a :: Type) (b :: Type) => + (a :: Type) -> (b :: Type) -> { a :: (a :: Type), b :: (b :: Type) } Types Pair :: Type -> Type -> Constraint diff --git a/tests-integration/fixtures/checking/124_instance_member_missing_constraint/Main.snap b/tests-integration/fixtures/checking/124_instance_member_missing_constraint/Main.snap index 124224bd..1db76903 100644 --- a/tests-integration/fixtures/checking/124_instance_member_missing_constraint/Main.snap +++ b/tests-integration/fixtures/checking/124_instance_member_missing_constraint/Main.snap @@ -3,9 +3,14 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String -map :: forall (f :: Type -> Type) (a :: Type) (b :: Type). Functor f => (a -> b) -> f a -> f b -Box :: forall (a :: Type). a -> Box a +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String +map :: + forall (f :: Type -> Type) (a :: Type) (b :: Type). + Functor (f :: Type -> Type) => + ((a :: Type) -> (b :: Type)) -> + (f :: Type -> Type) (a :: Type) -> + (f :: Type -> Type) (b :: Type) +Box :: forall (a :: Type). (a :: Type) -> Box (a :: Type) Types Show :: Type -> Constraint @@ -30,4 +35,4 @@ instance Functor (Box :: Type -> Type) chain: 0 Errors -NoInstanceFound { Show ~&1 } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Show (~&1 :: Type) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/125_instance_member_overly_general/Main.snap b/tests-integration/fixtures/checking/125_instance_member_overly_general/Main.snap index 2c05e19c..1cfd3b3c 100644 --- a/tests-integration/fixtures/checking/125_instance_member_overly_general/Main.snap +++ b/tests-integration/fixtures/checking/125_instance_member_overly_general/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String Types Show :: Type -> Constraint @@ -16,5 +16,5 @@ instance Show (Boolean :: Type) chain: 0 Errors -CannotUnify { forall (a :: Type). a -> String, Boolean -> String } at [TermDeclaration(Idx::(1))] -InstanceMemberTypeMismatch { expected: Boolean -> String, actual: forall (a :: Type). a -> String } at [TermDeclaration(Idx::(1))] +CannotUnify { forall (a :: Type). (a :: Type) -> String, Boolean -> String } at [TermDeclaration(Idx::(1))] +InstanceMemberTypeMismatch { expected: Boolean -> String, actual: forall (a :: Type). (a :: Type) -> String } at [TermDeclaration(Idx::(1))] diff --git a/tests-integration/fixtures/checking/126_instance_phantom/Main.snap b/tests-integration/fixtures/checking/126_instance_phantom/Main.snap index 30689b33..671b5468 100644 --- a/tests-integration/fixtures/checking/126_instance_phantom/Main.snap +++ b/tests-integration/fixtures/checking/126_instance_phantom/Main.snap @@ -3,13 +3,14 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -identity :: forall (a :: Type). Phantom a => a -> a -Proxy :: forall (t1 :: Type) (a :: t1). Proxy @t1 a -forceSolve :: forall (t8 :: Type) (t9 :: t8). { solution :: Proxy @t8 t9 } +identity :: forall (a :: Type). Phantom (a :: Type) => (a :: Type) -> (a :: Type) +Proxy :: forall (t1 :: Type) (a :: (t1 :: Type)). Proxy @(t1 :: Type) (a :: (t1 :: Type)) +forceSolve :: + forall (t8 :: Type) (t9 :: (t8 :: Type)). { solution :: Proxy @(t8 :: Type) (t9 :: ???) } Types Phantom :: Type -> Constraint -Proxy :: forall (t1 :: Type). t1 -> Type +Proxy :: forall (t1 :: Type). (t1 :: Type) -> Type Data Proxy @@ -24,5 +25,5 @@ Classes class Phantom (&0 :: Type) Instances -instance forall (&0 :: Type). Phantom (Proxy @&0 &1 :: Type) +instance forall (&0 :: Type). Phantom (Proxy @(&0 :: Type) (&1 :: (&0 :: Type)) :: Type) chain: 0 diff --git a/tests-integration/fixtures/checking/127_derive_eq_simple/Main.snap b/tests-integration/fixtures/checking/127_derive_eq_simple/Main.snap index 01ef762c..e22867b9 100644 --- a/tests-integration/fixtures/checking/127_derive_eq_simple/Main.snap +++ b/tests-integration/fixtures/checking/127_derive_eq_simple/Main.snap @@ -3,12 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (t0 :: Type) (a :: t0). Proxy @t0 a +Proxy :: forall (t0 :: Type) (a :: (t0 :: Type)). Proxy @(t0 :: Type) (a :: (t0 :: Type)) MkNoEq :: NoEq MkContainsNoEq :: NoEq -> ContainsNoEq Types -Proxy :: forall (t0 :: Type). t0 -> Type +Proxy :: forall (t0 :: Type). (t0 :: Type) -> Type NoEq :: Type ContainsNoEq :: Type @@ -32,7 +32,7 @@ NoEq = [] ContainsNoEq = [] Derived -derive forall (&0 :: Type). Eq (Proxy @&0 &1 :: Type) +derive forall (&0 :: Type). Eq (Proxy @(&0 :: Type) (&1 :: (&0 :: Type)) :: Type) derive Eq (ContainsNoEq :: Type) Errors diff --git a/tests-integration/fixtures/checking/128_type_operator_mutual/Main.snap b/tests-integration/fixtures/checking/128_type_operator_mutual/Main.snap index e69231b5..c2ff373e 100644 --- a/tests-integration/fixtures/checking/128_type_operator_mutual/Main.snap +++ b/tests-integration/fixtures/checking/128_type_operator_mutual/Main.snap @@ -3,11 +3,14 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -MkAdd :: forall (t1 :: Type) (t3 :: Type) (a :: t1) (b :: t3). a + b -> Add @t1 @t3 a b +MkAdd :: + forall (t1 :: Type) (t3 :: Type) (a :: (t1 :: Type)) (b :: (t3 :: Type)). + (a :: (t1 :: Type)) + (b :: (t3 :: Type)) -> + Add @(t1 :: Type) @(t3 :: Type) (a :: (t1 :: Type)) (b :: (t3 :: Type)) Types -Add :: forall (t1 :: Type) (t3 :: Type). t1 -> t3 -> Type -+ :: forall (t1 :: Type) (t3 :: Type). t1 -> t3 -> Type +Add :: forall (t1 :: Type) (t3 :: Type). (t1 :: Type) -> (t3 :: Type) -> Type ++ :: forall (t1 :: Type) (t3 :: Type). (t1 :: Type) -> (t3 :: Type) -> Type Data Add diff --git a/tests-integration/fixtures/checking/130_derive_eq_parameterized/Main.snap b/tests-integration/fixtures/checking/130_derive_eq_parameterized/Main.snap index 000c34be..c618f3a5 100644 --- a/tests-integration/fixtures/checking/130_derive_eq_parameterized/Main.snap +++ b/tests-integration/fixtures/checking/130_derive_eq_parameterized/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) Types Maybe :: Type -> Type @@ -19,4 +19,4 @@ Roles Maybe = [Representational] Derived -derive Eq &0 => Eq (Maybe &0 :: Type) +derive Eq (&0 :: Type) => Eq (Maybe (&0 :: Type) :: Type) diff --git a/tests-integration/fixtures/checking/132_derive_eq_1_higher_kinded/Main.snap b/tests-integration/fixtures/checking/132_derive_eq_1_higher_kinded/Main.snap index fe7b919e..60acc659 100644 --- a/tests-integration/fixtures/checking/132_derive_eq_1_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/132_derive_eq_1_higher_kinded/Main.snap @@ -3,12 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -MkWrap :: forall (t4 :: Type) (f :: t4 -> Type) (a :: t4). f a -> Wrap @t4 f a -MkWrapNoEq1 :: forall (t10 :: Type) (f :: t10 -> Type) (a :: t10). f a -> WrapNoEq1 @t10 f a +MkWrap :: + forall (t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)). + (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) -> + Wrap @(t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) +MkWrapNoEq1 :: + forall (t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)). + (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) -> + WrapNoEq1 @(t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) Types -Wrap :: forall (t4 :: Type). (t4 -> Type) -> t4 -> Type -WrapNoEq1 :: forall (t10 :: Type). (t10 -> Type) -> t10 -> Type +Wrap :: forall (t4 :: Type). ((t4 :: Type) -> Type) -> (t4 :: Type) -> Type +WrapNoEq1 :: forall (t10 :: Type). ((t10 :: Type) -> Type) -> (t10 :: Type) -> Type Data Wrap @@ -25,8 +31,8 @@ Wrap = [Representational, Nominal] WrapNoEq1 = [Representational, Nominal] Derived -derive (Eq1 &0, Eq &1) => Eq (Wrap @Type &0 &1 :: Type) -derive Eq &1 => Eq (WrapNoEq1 @Type &0 &1 :: Type) +derive (Eq1 (&0 :: Type -> Type), Eq (&1 :: Type)) => Eq (Wrap @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) +derive Eq (&1 :: Type) => Eq (WrapNoEq1 @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) Errors -NoInstanceFound { Eq1 &0 } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Eq1 (&0 :: Type -> Type) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/133_derive_eq_partial/Main.snap b/tests-integration/fixtures/checking/133_derive_eq_partial/Main.snap index 65d7fda5..f017cb82 100644 --- a/tests-integration/fixtures/checking/133_derive_eq_partial/Main.snap +++ b/tests-integration/fixtures/checking/133_derive_eq_partial/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) Types Either :: Type -> Type -> Type @@ -19,8 +19,8 @@ Roles Either = [Representational, Representational] Derived -derive Eq &0 => Eq (Either Int &0 :: Type) -derive Eq (Either Int &0 :: Type) +derive Eq (&0 :: Type) => Eq (Either Int (&0 :: Type) :: Type) +derive Eq (Either Int (&0 :: Type) :: Type) Errors -NoInstanceFound { Eq &0 } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Eq (&0 :: Type) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/135_derive_ord_1_higher_kinded/Main.snap b/tests-integration/fixtures/checking/135_derive_ord_1_higher_kinded/Main.snap index 069f554b..2a435bb5 100644 --- a/tests-integration/fixtures/checking/135_derive_ord_1_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/135_derive_ord_1_higher_kinded/Main.snap @@ -3,12 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -MkWrap :: forall (t4 :: Type) (f :: t4 -> Type) (a :: t4). f a -> Wrap @t4 f a -MkWrapNoOrd1 :: forall (t10 :: Type) (f :: t10 -> Type) (a :: t10). f a -> WrapNoOrd1 @t10 f a +MkWrap :: + forall (t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)). + (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) -> + Wrap @(t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) +MkWrapNoOrd1 :: + forall (t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)). + (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) -> + WrapNoOrd1 @(t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) Types -Wrap :: forall (t4 :: Type). (t4 -> Type) -> t4 -> Type -WrapNoOrd1 :: forall (t10 :: Type). (t10 -> Type) -> t10 -> Type +Wrap :: forall (t4 :: Type). ((t4 :: Type) -> Type) -> (t4 :: Type) -> Type +WrapNoOrd1 :: forall (t10 :: Type). ((t10 :: Type) -> Type) -> (t10 :: Type) -> Type Data Wrap @@ -25,11 +31,11 @@ Wrap = [Representational, Nominal] WrapNoOrd1 = [Representational, Nominal] Derived -derive (Eq1 &0, Eq &1) => Eq (Wrap @Type &0 &1 :: Type) -derive (Ord1 &0, Ord &1) => Ord (Wrap @Type &0 &1 :: Type) -derive (Eq1 &0, Eq &1) => Eq (WrapNoOrd1 @Type &0 &1 :: Type) -derive Ord &1 => Ord (WrapNoOrd1 @Type &0 &1 :: Type) +derive (Eq1 (&0 :: Type -> Type), Eq (&1 :: Type)) => Eq (Wrap @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) +derive (Ord1 (&0 :: Type -> Type), Ord (&1 :: Type)) => Ord (Wrap @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) +derive (Eq1 (&0 :: Type -> Type), Eq (&1 :: Type)) => Eq (WrapNoOrd1 @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) +derive Ord (&1 :: Type) => Ord (WrapNoOrd1 @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) Errors -NoInstanceFound { Ord1 &0 } at [TermDeclaration(Idx::(5))] -NoInstanceFound { Eq1 &0 } at [TermDeclaration(Idx::(5))] +NoInstanceFound { Ord1 (&0 :: Type -> Type) } at [TermDeclaration(Idx::(5))] +NoInstanceFound { Eq1 (&0 :: Type -> Type) } at [TermDeclaration(Idx::(5))] diff --git a/tests-integration/fixtures/checking/136_derive_nested_higher_kinded/Main.snap b/tests-integration/fixtures/checking/136_derive_nested_higher_kinded/Main.snap index 3bffb8dd..2487ddad 100644 --- a/tests-integration/fixtures/checking/136_derive_nested_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/136_derive_nested_higher_kinded/Main.snap @@ -3,17 +3,23 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -T :: forall (t4 :: Type) (f :: t4 -> Type) (g :: Type -> t4). f (g Int) -> T f g -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a -U :: forall (f :: Type -> Type). f (Maybe Int) -> U f -V :: forall (t20 :: Type) (f :: t20 -> Type) (g :: Int -> t20). f (g 42) -> V f g +T :: + forall (t4 :: Type) (f :: (t4 :: Type) -> Type) (g :: Type -> (t4 :: Type)). + (f :: (t4 :: Type) -> Type) ((g :: Type -> (t4 :: Type)) Int) -> + T (f :: (t4 :: Type) -> Type) (g :: Type -> (t4 :: Type)) +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +U :: forall (f :: Type -> Type). (f :: Type -> Type) (Maybe Int) -> U (f :: Type -> Type) +V :: + forall (t20 :: Type) (f :: (t20 :: Type) -> Type) (g :: Int -> (t20 :: Type)). + (f :: (t20 :: Type) -> Type) ((g :: Int -> (t20 :: Type)) 42) -> + V (f :: (t20 :: Type) -> Type) (g :: Int -> (t20 :: Type)) Types -T :: forall (t4 :: Type). (t4 -> Type) -> (Type -> t4) -> Type +T :: forall (t4 :: Type). ((t4 :: Type) -> Type) -> (Type -> (t4 :: Type)) -> Type Maybe :: Type -> Type U :: (Type -> Type) -> Type -V :: forall (t20 :: Type). (t20 -> Type) -> (Int -> t20) -> Type +V :: forall (t20 :: Type). ((t20 :: Type) -> Type) -> (Int -> (t20 :: Type)) -> Type Data T @@ -40,17 +46,17 @@ U = [Representational] V = [Representational, Representational] Derived -derive Eq1 &0 => Eq (V @Type &0 &1 :: Type) -derive Ord1 &0 => Ord (V @Type &0 &1 :: Type) -derive Eq1 &0 => Eq (T @Type &0 &1 :: Type) -derive Ord1 &0 => Ord (T @Type &0 &1 :: Type) -derive Eq &0 => Eq (Maybe &0 :: Type) -derive Ord &0 => Ord (Maybe &0 :: Type) -derive Eq1 &0 => Eq (U &0 :: Type) -derive Ord1 &0 => Ord (U &0 :: Type) +derive Eq1 (&0 :: Type -> Type) => Eq (V @Type (&0 :: Type -> Type) (&1 :: Int -> Type) :: Type) +derive Ord1 (&0 :: Type -> Type) => Ord (V @Type (&0 :: Type -> Type) (&1 :: Int -> Type) :: Type) +derive Eq1 (&0 :: Type -> Type) => Eq (T @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type) +derive Ord1 (&0 :: Type -> Type) => Ord (T @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type) +derive Eq (&0 :: Type) => Eq (Maybe (&0 :: Type) :: Type) +derive Ord (&0 :: Type) => Ord (Maybe (&0 :: Type) :: Type) +derive Eq1 (&0 :: Type -> Type) => Eq (U (&0 :: Type -> Type) :: Type) +derive Ord1 (&0 :: Type -> Type) => Ord (U (&0 :: Type -> Type) :: Type) Errors -NoInstanceFound { Eq (&1 Int) } at [TermDeclaration(Idx::(1))] -NoInstanceFound { Ord (&1 Int) } at [TermDeclaration(Idx::(2))] -NoInstanceFound { Eq (&1 42) } at [TermDeclaration(Idx::(11))] -NoInstanceFound { Ord (&1 42) } at [TermDeclaration(Idx::(12))] +NoInstanceFound { Eq ((&1 :: Type -> Type) Int) } at [TermDeclaration(Idx::(1))] +NoInstanceFound { Ord ((&1 :: Type -> Type) Int) } at [TermDeclaration(Idx::(2))] +NoInstanceFound { Eq ((&1 :: Int -> Type) 42) } at [TermDeclaration(Idx::(11))] +NoInstanceFound { Ord ((&1 :: Int -> Type) 42) } at [TermDeclaration(Idx::(12))] diff --git a/tests-integration/fixtures/checking/138_derive_newtype_parameterized/Main.snap b/tests-integration/fixtures/checking/138_derive_newtype_parameterized/Main.snap index 0bf73312..69a2e6c5 100644 --- a/tests-integration/fixtures/checking/138_derive_newtype_parameterized/Main.snap +++ b/tests-integration/fixtures/checking/138_derive_newtype_parameterized/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) Types Identity :: Type -> Type diff --git a/tests-integration/fixtures/checking/139_derive_newtype_with_given/Main.snap b/tests-integration/fixtures/checking/139_derive_newtype_with_given/Main.snap index 1af357a5..82d96445 100644 --- a/tests-integration/fixtures/checking/139_derive_newtype_with_given/Main.snap +++ b/tests-integration/fixtures/checking/139_derive_newtype_with_given/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) Types Identity :: Type -> Type @@ -18,4 +18,4 @@ Roles Identity = [Representational] Derived -derive Show &0 => Show (Identity &0 :: Type) +derive Show (&0 :: Type) => Show (Identity (&0 :: Type) :: Type) diff --git a/tests-integration/fixtures/checking/140_derive_newtype_recursive/Main.snap b/tests-integration/fixtures/checking/140_derive_newtype_recursive/Main.snap index a43f2a32..5e036496 100644 --- a/tests-integration/fixtures/checking/140_derive_newtype_recursive/Main.snap +++ b/tests-integration/fixtures/checking/140_derive_newtype_recursive/Main.snap @@ -3,7 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Mu :: forall (f :: Type -> Type). f (Mu f) -> Mu f +Mu :: + forall (f :: Type -> Type). (f :: Type -> Type) (Mu (f :: Type -> Type)) -> Mu (f :: Type -> Type) Types Mu :: (Type -> Type) -> Type @@ -18,4 +19,4 @@ Roles Mu = [Representational] Derived -derive Show (&0 (Mu &0)) => Show (Mu &0 :: Type) +derive Show ((&0 :: Type -> Type) (Mu (&0 :: Type -> Type))) => Show (Mu (&0 :: Type -> Type) :: Type) diff --git a/tests-integration/fixtures/checking/141_derive_newtype_phantom/Main.snap b/tests-integration/fixtures/checking/141_derive_newtype_phantom/Main.snap index 71582a9d..a1802470 100644 --- a/tests-integration/fixtures/checking/141_derive_newtype_phantom/Main.snap +++ b/tests-integration/fixtures/checking/141_derive_newtype_phantom/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Vector :: forall (n :: Int) (a :: Type). Array a -> Vector n a +Vector :: forall (n :: Int) (a :: Type). Array (a :: Type) -> Vector (n :: Int) (a :: Type) Types Vector :: Int -> Type -> Type @@ -18,4 +18,4 @@ Roles Vector = [Phantom, Representational] Derived -derive Show &1 => Show (Vector &0 &1 :: Type) +derive Show (&1 :: Type) => Show (Vector (&0 :: Int) (&1 :: Type) :: Type) diff --git a/tests-integration/fixtures/checking/143_derive_newtype_missing_instance/Main.snap b/tests-integration/fixtures/checking/143_derive_newtype_missing_instance/Main.snap index 6fdb0231..480797cd 100644 --- a/tests-integration/fixtures/checking/143_derive_newtype_missing_instance/Main.snap +++ b/tests-integration/fixtures/checking/143_derive_newtype_missing_instance/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) Types Identity :: Type -> Type diff --git a/tests-integration/fixtures/checking/144_derive_newtype_missing_given/Main.snap b/tests-integration/fixtures/checking/144_derive_newtype_missing_given/Main.snap index 1ce47204..0b2c6fb5 100644 --- a/tests-integration/fixtures/checking/144_derive_newtype_missing_given/Main.snap +++ b/tests-integration/fixtures/checking/144_derive_newtype_missing_given/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) Types Identity :: Type -> Type @@ -18,7 +18,7 @@ Roles Identity = [Representational] Derived -derive Show (Identity &0 :: Type) +derive Show (Identity (&0 :: Type) :: Type) Errors -NoInstanceFound { Show &0 } at [TermDeclaration(Idx::(1))] +NoInstanceFound { Show (&0 :: Type) } at [TermDeclaration(Idx::(1))] diff --git a/tests-integration/fixtures/checking/145_derive_newtype_multi_param/Main.snap b/tests-integration/fixtures/checking/145_derive_newtype_multi_param/Main.snap index d0998052..4950fe0a 100644 --- a/tests-integration/fixtures/checking/145_derive_newtype_multi_param/Main.snap +++ b/tests-integration/fixtures/checking/145_derive_newtype_multi_param/Main.snap @@ -3,10 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Pair :: forall (t1 :: Type) (a :: Type) (b :: t1). a -> Pair @t1 a b +Pair :: + forall (t1 :: Type) (a :: Type) (b :: (t1 :: Type)). + (a :: Type) -> Pair @(t1 :: Type) (a :: Type) (b :: (t1 :: Type)) Types -Pair :: forall (t1 :: Type). Type -> t1 -> Type +Pair :: forall (t1 :: Type). Type -> (t1 :: Type) -> Type Data Pair diff --git a/tests-integration/fixtures/checking/146_derive_functor_simple/Main.snap b/tests-integration/fixtures/checking/146_derive_functor_simple/Main.snap index 4b99ee66..cde36672 100644 --- a/tests-integration/fixtures/checking/146_derive_functor_simple/Main.snap +++ b/tests-integration/fixtures/checking/146_derive_functor_simple/Main.snap @@ -3,14 +3,16 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a -Const :: forall (t2 :: Type) (e :: Type) (a :: t2). e -> Const @t2 e a -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) +Const :: + forall (t2 :: Type) (e :: Type) (a :: (t2 :: Type)). + (e :: Type) -> Const @(t2 :: Type) (e :: Type) (a :: (t2 :: Type)) +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) Types Identity :: Type -> Type -Const :: forall (t2 :: Type). Type -> t2 -> Type +Const :: forall (t2 :: Type). Type -> (t2 :: Type) -> Type Maybe :: Type -> Type Data @@ -34,5 +36,5 @@ Maybe = [Representational] Derived derive Functor (Identity :: Type -> Type) -derive Functor (Const @Type &0 :: Type -> Type) +derive Functor (Const @Type (&0 :: Type) :: Type -> Type) derive Functor (Maybe :: Type -> Type) diff --git a/tests-integration/fixtures/checking/147_derive_functor_higher_kinded/Main.snap b/tests-integration/fixtures/checking/147_derive_functor_higher_kinded/Main.snap index c511ba0a..4c3642bd 100644 --- a/tests-integration/fixtures/checking/147_derive_functor_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/147_derive_functor_higher_kinded/Main.snap @@ -3,12 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Wrap :: forall (t4 :: Type) (f :: t4 -> Type) (a :: t4). f a -> Wrap @t4 f a -WrapNoFunctor :: forall (t10 :: Type) (f :: t10 -> Type) (a :: t10). f a -> WrapNoFunctor @t10 f a +Wrap :: + forall (t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)). + (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) -> + Wrap @(t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) +WrapNoFunctor :: + forall (t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)). + (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) -> + WrapNoFunctor @(t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) Types -Wrap :: forall (t4 :: Type). (t4 -> Type) -> t4 -> Type -WrapNoFunctor :: forall (t10 :: Type). (t10 -> Type) -> t10 -> Type +Wrap :: forall (t4 :: Type). ((t4 :: Type) -> Type) -> (t4 :: Type) -> Type +WrapNoFunctor :: forall (t10 :: Type). ((t10 :: Type) -> Type) -> (t10 :: Type) -> Type Data Wrap @@ -25,8 +31,8 @@ Wrap = [Representational, Nominal] WrapNoFunctor = [Representational, Nominal] Derived -derive Functor &0 => Functor (Wrap @Type &0 :: Type -> Type) -derive Functor (WrapNoFunctor @Type &0 :: Type -> Type) +derive Functor (&0 :: Type -> Type) => Functor (Wrap @Type (&0 :: Type -> Type) :: Type -> Type) +derive Functor (WrapNoFunctor @Type (&0 :: Type -> Type) :: Type -> Type) Errors -NoInstanceFound { Functor &0 } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Functor (&0 :: Type -> Type) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/148_derive_functor_contravariant_error/Main.snap b/tests-integration/fixtures/checking/148_derive_functor_contravariant_error/Main.snap index bda806e5..05a05de4 100644 --- a/tests-integration/fixtures/checking/148_derive_functor_contravariant_error/Main.snap +++ b/tests-integration/fixtures/checking/148_derive_functor_contravariant_error/Main.snap @@ -3,9 +3,12 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Predicate :: forall (a :: Type). (a -> Boolean) -> Predicate a -Reader :: forall (r :: Type) (a :: Type). (r -> a) -> Reader r a -Cont :: forall (r :: Type) (a :: Type). ((a -> r) -> r) -> Cont r a +Predicate :: forall (a :: Type). ((a :: Type) -> Boolean) -> Predicate (a :: Type) +Reader :: + forall (r :: Type) (a :: Type). ((r :: Type) -> (a :: Type)) -> Reader (r :: Type) (a :: Type) +Cont :: + forall (r :: Type) (a :: Type). + (((a :: Type) -> (r :: Type)) -> (r :: Type)) -> Cont (r :: Type) (a :: Type) Types Predicate :: Type -> Type @@ -33,8 +36,8 @@ Cont = [Representational, Representational] Derived derive Functor (Predicate :: Type -> Type) -derive Functor (Reader &0 :: Type -> Type) -derive Functor (Cont &0 :: Type -> Type) +derive Functor (Reader (&0 :: Type) :: Type -> Type) +derive Functor (Cont (&0 :: Type) :: Type -> Type) Errors -ContravariantOccurrence { type_id: Id(44) } at [TermDeclaration(Idx::(1))] +ContravariantOccurrence { type_id: Id(45) } at [TermDeclaration(Idx::(1))] diff --git a/tests-integration/fixtures/checking/149_derive_bifunctor_simple/Main.snap b/tests-integration/fixtures/checking/149_derive_bifunctor_simple/Main.snap index b659adfc..c5aab060 100644 --- a/tests-integration/fixtures/checking/149_derive_bifunctor_simple/Main.snap +++ b/tests-integration/fixtures/checking/149_derive_bifunctor_simple/Main.snap @@ -3,16 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b -Pair :: forall (a :: Type) (b :: Type). a -> b -> Pair a b +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) +Pair :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Pair (a :: Type) (b :: Type) Const2 :: - forall (t5 :: Type) (t6 :: Type) (e :: Type) (a :: t5) (b :: t6). e -> Const2 @t5 @t6 e a b + forall (t5 :: Type) (t6 :: Type) (e :: Type) (a :: (t5 :: Type)) (b :: (t6 :: Type)). + (e :: Type) -> + Const2 @(t5 :: Type) @(t6 :: Type) (e :: Type) (a :: (t5 :: Type)) (b :: (t6 :: Type)) Types Either :: Type -> Type -> Type Pair :: Type -> Type -> Type -Const2 :: forall (t5 :: Type) (t6 :: Type). Type -> t5 -> t6 -> Type +Const2 :: forall (t5 :: Type) (t6 :: Type). Type -> (t5 :: Type) -> (t6 :: Type) -> Type Data Either @@ -36,4 +38,4 @@ Const2 = [Representational, Phantom, Phantom] Derived derive Bifunctor (Either :: Type -> Type -> Type) derive Bifunctor (Pair :: Type -> Type -> Type) -derive Bifunctor (Const2 @Type @Type &0 :: Type -> Type -> Type) +derive Bifunctor (Const2 @Type @Type (&0 :: Type) :: Type -> Type -> Type) diff --git a/tests-integration/fixtures/checking/150_derive_bifunctor_higher_kinded/Main.snap b/tests-integration/fixtures/checking/150_derive_bifunctor_higher_kinded/Main.snap index 2af3fdac..39402b81 100644 --- a/tests-integration/fixtures/checking/150_derive_bifunctor_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/150_derive_bifunctor_higher_kinded/Main.snap @@ -4,16 +4,33 @@ expression: report --- Terms WrapBoth :: - forall (t6 :: Type) (t10 :: Type) (f :: t6 -> Type) (g :: t10 -> Type) (a :: t6) (b :: t10). - f a -> g b -> WrapBoth @t6 @t10 f g a b + forall (t6 :: Type) (t10 :: Type) (f :: (t6 :: Type) -> Type) (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) (b :: (t10 :: Type)). + (f :: (t6 :: Type) -> Type) (a :: (t6 :: Type)) -> + (g :: (t10 :: Type) -> Type) (b :: (t10 :: Type)) -> + WrapBoth @(t6 :: Type) @(t10 :: Type) + (f :: (t6 :: Type) -> Type) + (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) + (b :: (t10 :: Type)) WrapBothNoConstraint :: - forall (t18 :: Type) (t22 :: Type) (f :: t18 -> Type) (g :: t22 -> Type) (a :: t18) (b :: t22). - f a -> g b -> WrapBothNoConstraint @t18 @t22 f g a b + forall (t18 :: Type) (t22 :: Type) (f :: (t18 :: Type) -> Type) (g :: (t22 :: Type) -> Type) + (a :: (t18 :: Type)) (b :: (t22 :: Type)). + (f :: (t18 :: Type) -> Type) (a :: (t18 :: Type)) -> + (g :: (t22 :: Type) -> Type) (b :: (t22 :: Type)) -> + WrapBothNoConstraint @(t18 :: Type) @(t22 :: Type) + (f :: (t18 :: Type) -> Type) + (g :: (t22 :: Type) -> Type) + (a :: (t18 :: Type)) + (b :: (t22 :: Type)) Types -WrapBoth :: forall (t6 :: Type) (t10 :: Type). (t6 -> Type) -> (t10 -> Type) -> t6 -> t10 -> Type +WrapBoth :: + forall (t6 :: Type) (t10 :: Type). + ((t6 :: Type) -> Type) -> ((t10 :: Type) -> Type) -> (t6 :: Type) -> (t10 :: Type) -> Type WrapBothNoConstraint :: - forall (t18 :: Type) (t22 :: Type). (t18 -> Type) -> (t22 -> Type) -> t18 -> t22 -> Type + forall (t18 :: Type) (t22 :: Type). + ((t18 :: Type) -> Type) -> ((t22 :: Type) -> Type) -> (t18 :: Type) -> (t22 :: Type) -> Type Data WrapBoth @@ -30,9 +47,9 @@ WrapBoth = [Representational, Representational, Nominal, Nominal] WrapBothNoConstraint = [Representational, Representational, Nominal, Nominal] Derived -derive (Functor &0, Functor &1) => Bifunctor (WrapBoth @Type @Type &0 &1 :: Type -> Type -> Type) -derive Bifunctor (WrapBothNoConstraint @Type @Type &0 &1 :: Type -> Type -> Type) +derive (Functor (&0 :: Type -> Type), Functor (&1 :: Type -> Type)) => Bifunctor (WrapBoth @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) +derive Bifunctor (WrapBothNoConstraint @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) Errors -NoInstanceFound { Functor &0 } at [TermDeclaration(Idx::(3))] -NoInstanceFound { Functor &1 } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Functor (&0 :: Type -> Type) } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Functor (&1 :: Type -> Type) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/151_derive_bifunctor_missing_functor/Main.snap b/tests-integration/fixtures/checking/151_derive_bifunctor_missing_functor/Main.snap index 3c19e666..80506f29 100644 --- a/tests-integration/fixtures/checking/151_derive_bifunctor_missing_functor/Main.snap +++ b/tests-integration/fixtures/checking/151_derive_bifunctor_missing_functor/Main.snap @@ -4,11 +4,20 @@ expression: report --- Terms WrapBoth :: - forall (t6 :: Type) (t10 :: Type) (f :: t6 -> Type) (g :: t10 -> Type) (a :: t6) (b :: t10). - f a -> g b -> WrapBoth @t6 @t10 f g a b + forall (t6 :: Type) (t10 :: Type) (f :: (t6 :: Type) -> Type) (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) (b :: (t10 :: Type)). + (f :: (t6 :: Type) -> Type) (a :: (t6 :: Type)) -> + (g :: (t10 :: Type) -> Type) (b :: (t10 :: Type)) -> + WrapBoth @(t6 :: Type) @(t10 :: Type) + (f :: (t6 :: Type) -> Type) + (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) + (b :: (t10 :: Type)) Types -WrapBoth :: forall (t6 :: Type) (t10 :: Type). (t6 -> Type) -> (t10 -> Type) -> t6 -> t10 -> Type +WrapBoth :: + forall (t6 :: Type) (t10 :: Type). + ((t6 :: Type) -> Type) -> ((t10 :: Type) -> Type) -> (t6 :: Type) -> (t10 :: Type) -> Type Data WrapBoth @@ -20,7 +29,7 @@ Roles WrapBoth = [Representational, Representational, Nominal, Nominal] Derived -derive Bifunctor (WrapBoth @Type @Type &0 &1 :: Type -> Type -> Type) +derive Bifunctor (WrapBoth @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) Errors DeriveMissingFunctor at [TermDeclaration(Idx::(1))] diff --git a/tests-integration/fixtures/checking/152_derive_contravariant_simple/Main.snap b/tests-integration/fixtures/checking/152_derive_contravariant_simple/Main.snap index dff8c108..fb24b6f7 100644 --- a/tests-integration/fixtures/checking/152_derive_contravariant_simple/Main.snap +++ b/tests-integration/fixtures/checking/152_derive_contravariant_simple/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Predicate :: forall (a :: Type). (a -> Boolean) -> Predicate a -Comparison :: forall (a :: Type). (a -> a -> Boolean) -> Comparison a -Op :: forall (a :: Type) (b :: Type). (b -> a) -> Op a b +Predicate :: forall (a :: Type). ((a :: Type) -> Boolean) -> Predicate (a :: Type) +Comparison :: forall (a :: Type). ((a :: Type) -> (a :: Type) -> Boolean) -> Comparison (a :: Type) +Op :: forall (a :: Type) (b :: Type). ((b :: Type) -> (a :: Type)) -> Op (a :: Type) (b :: Type) Types Predicate :: Type -> Type @@ -34,4 +34,4 @@ Op = [Representational, Representational] Derived derive Contravariant (Predicate :: Type -> Type) derive Contravariant (Comparison :: Type -> Type) -derive Contravariant (Op &0 :: Type -> Type) +derive Contravariant (Op (&0 :: Type) :: Type -> Type) diff --git a/tests-integration/fixtures/checking/153_derive_contravariant_error/Main.snap b/tests-integration/fixtures/checking/153_derive_contravariant_error/Main.snap index 261f65b8..2ee1b9db 100644 --- a/tests-integration/fixtures/checking/153_derive_contravariant_error/Main.snap +++ b/tests-integration/fixtures/checking/153_derive_contravariant_error/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a -Producer :: forall (a :: Type). (Int -> a) -> Producer a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) +Producer :: forall (a :: Type). (Int -> (a :: Type)) -> Producer (a :: Type) Types Identity :: Type -> Type @@ -29,5 +29,5 @@ derive Contravariant (Identity :: Type -> Type) derive Contravariant (Producer :: Type -> Type) Errors -CovariantOccurrence { type_id: Id(33) } at [TermDeclaration(Idx::(1))] -CovariantOccurrence { type_id: Id(33) } at [TermDeclaration(Idx::(3))] +CovariantOccurrence { type_id: Id(34) } at [TermDeclaration(Idx::(1))] +CovariantOccurrence { type_id: Id(34) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/154_derive_profunctor_simple/Main.snap b/tests-integration/fixtures/checking/154_derive_profunctor_simple/Main.snap index bdf61386..48d1414a 100644 --- a/tests-integration/fixtures/checking/154_derive_profunctor_simple/Main.snap +++ b/tests-integration/fixtures/checking/154_derive_profunctor_simple/Main.snap @@ -3,14 +3,16 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Fn :: forall (a :: Type) (b :: Type). (a -> b) -> Fn a b -ConstR :: forall (t4 :: Type) (r :: Type) (a :: Type) (b :: t4). (a -> r) -> ConstR @t4 r a b -GoLeft :: forall (a :: Type) (b :: Type). (a -> Int) -> Choice a b -GoRight :: forall (a :: Type) (b :: Type). b -> Choice a b +Fn :: forall (a :: Type) (b :: Type). ((a :: Type) -> (b :: Type)) -> Fn (a :: Type) (b :: Type) +ConstR :: + forall (t4 :: Type) (r :: Type) (a :: Type) (b :: (t4 :: Type)). + ((a :: Type) -> (r :: Type)) -> ConstR @(t4 :: Type) (r :: Type) (a :: Type) (b :: (t4 :: Type)) +GoLeft :: forall (a :: Type) (b :: Type). ((a :: Type) -> Int) -> Choice (a :: Type) (b :: Type) +GoRight :: forall (a :: Type) (b :: Type). (b :: Type) -> Choice (a :: Type) (b :: Type) Types Fn :: Type -> Type -> Type -ConstR :: forall (t4 :: Type). Type -> Type -> t4 -> Type +ConstR :: forall (t4 :: Type). Type -> Type -> (t4 :: Type) -> Type Choice :: Type -> Type -> Type Data @@ -34,5 +36,5 @@ Choice = [Representational, Representational] Derived derive Profunctor (Fn :: Type -> Type -> Type) -derive Profunctor (ConstR @Type &0 :: Type -> Type -> Type) +derive Profunctor (ConstR @Type (&0 :: Type) :: Type -> Type -> Type) derive Profunctor (Choice :: Type -> Type -> Type) diff --git a/tests-integration/fixtures/checking/155_derive_profunctor_error/Main.snap b/tests-integration/fixtures/checking/155_derive_profunctor_error/Main.snap index f123fd92..cdf626eb 100644 --- a/tests-integration/fixtures/checking/155_derive_profunctor_error/Main.snap +++ b/tests-integration/fixtures/checking/155_derive_profunctor_error/Main.snap @@ -3,8 +3,11 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -WrongFirst :: forall (a :: Type) (b :: Type). a -> b -> WrongFirst a b -WrongSecond :: forall (a :: Type) (b :: Type). (b -> a) -> WrongSecond a b +WrongFirst :: + forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> WrongFirst (a :: Type) (b :: Type) +WrongSecond :: + forall (a :: Type) (b :: Type). + ((b :: Type) -> (a :: Type)) -> WrongSecond (a :: Type) (b :: Type) Types WrongFirst :: Type -> Type -> Type @@ -29,6 +32,6 @@ derive Profunctor (WrongFirst :: Type -> Type -> Type) derive Profunctor (WrongSecond :: Type -> Type -> Type) Errors -CovariantOccurrence { type_id: Id(45) } at [TermDeclaration(Idx::(1))] -ContravariantOccurrence { type_id: Id(46) } at [TermDeclaration(Idx::(3))] -CovariantOccurrence { type_id: Id(45) } at [TermDeclaration(Idx::(3))] +CovariantOccurrence { type_id: Id(46) } at [TermDeclaration(Idx::(1))] +ContravariantOccurrence { type_id: Id(47) } at [TermDeclaration(Idx::(3))] +CovariantOccurrence { type_id: Id(46) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/156_derive_bifunctor_insufficient_params/Main.snap b/tests-integration/fixtures/checking/156_derive_bifunctor_insufficient_params/Main.snap index 65f6d595..25024b9a 100644 --- a/tests-integration/fixtures/checking/156_derive_bifunctor_insufficient_params/Main.snap +++ b/tests-integration/fixtures/checking/156_derive_bifunctor_insufficient_params/Main.snap @@ -3,7 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Triple :: forall (a :: Type) (b :: Type) (c :: Type). a -> b -> c -> Triple a b c +Triple :: + forall (a :: Type) (b :: Type) (c :: Type). + (a :: Type) -> (b :: Type) -> (c :: Type) -> Triple (a :: Type) (b :: Type) (c :: Type) Types Triple :: Type -> Type -> Type -> Type @@ -22,4 +24,4 @@ derive Bifunctor (Triple Int String :: Type -> Type) Errors CannotUnify { Type, Type -> Type } at [TermDeclaration(Idx::(1)), CheckingKind(AstId(21))] -CannotDeriveForType { type_id: Id(45) } at [TermDeclaration(Idx::(1))] +CannotDeriveForType { type_id: Id(46) } at [TermDeclaration(Idx::(1))] diff --git a/tests-integration/fixtures/checking/157_derive_functor_insufficient_params/Main.snap b/tests-integration/fixtures/checking/157_derive_functor_insufficient_params/Main.snap index eb192a78..7971d542 100644 --- a/tests-integration/fixtures/checking/157_derive_functor_insufficient_params/Main.snap +++ b/tests-integration/fixtures/checking/157_derive_functor_insufficient_params/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Pair :: forall (a :: Type) (b :: Type). a -> b -> Pair a b +Pair :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Pair (a :: Type) (b :: Type) Unit :: Unit Types @@ -30,6 +30,6 @@ derive Functor (Unit :: Type) Errors CannotUnify { Type, Type -> Type } at [TermDeclaration(Idx::(1)), CheckingKind(AstId(19))] -CannotDeriveForType { type_id: Id(34) } at [TermDeclaration(Idx::(1))] +CannotDeriveForType { type_id: Id(35) } at [TermDeclaration(Idx::(1))] CannotUnify { Type, Type -> Type } at [TermDeclaration(Idx::(3)), CheckingKind(AstId(28))] CannotDeriveForType { type_id: Id(17) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/158_derive_foldable_simple/Main.snap b/tests-integration/fixtures/checking/158_derive_foldable_simple/Main.snap index cdbb704d..0ab900c4 100644 --- a/tests-integration/fixtures/checking/158_derive_foldable_simple/Main.snap +++ b/tests-integration/fixtures/checking/158_derive_foldable_simple/Main.snap @@ -3,15 +3,17 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a -Const :: forall (t3 :: Type) (e :: Type) (a :: t3). e -> Const @t3 e a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +Const :: + forall (t3 :: Type) (e :: Type) (a :: (t3 :: Type)). + (e :: Type) -> Const @(t3 :: Type) (e :: Type) (a :: (t3 :: Type)) Types Identity :: Type -> Type Maybe :: Type -> Type -Const :: forall (t3 :: Type). Type -> t3 -> Type +Const :: forall (t3 :: Type). Type -> (t3 :: Type) -> Type Data Identity @@ -35,4 +37,4 @@ Const = [Representational, Phantom] Derived derive Foldable (Identity :: Type -> Type) derive Foldable (Maybe :: Type -> Type) -derive Foldable (Const @Type &0 :: Type -> Type) +derive Foldable (Const @Type (&0 :: Type) :: Type -> Type) diff --git a/tests-integration/fixtures/checking/159_derive_foldable_higher_kinded/Main.snap b/tests-integration/fixtures/checking/159_derive_foldable_higher_kinded/Main.snap index 282a1b5b..f53133c1 100644 --- a/tests-integration/fixtures/checking/159_derive_foldable_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/159_derive_foldable_higher_kinded/Main.snap @@ -3,12 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Wrap :: forall (t4 :: Type) (f :: t4 -> Type) (a :: t4). f a -> Wrap @t4 f a -WrapNoFoldable :: forall (t10 :: Type) (f :: t10 -> Type) (a :: t10). f a -> WrapNoFoldable @t10 f a +Wrap :: + forall (t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)). + (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) -> + Wrap @(t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) +WrapNoFoldable :: + forall (t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)). + (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) -> + WrapNoFoldable @(t10 :: Type) (f :: (t10 :: Type) -> Type) (a :: (t10 :: Type)) Types -Wrap :: forall (t4 :: Type). (t4 -> Type) -> t4 -> Type -WrapNoFoldable :: forall (t10 :: Type). (t10 -> Type) -> t10 -> Type +Wrap :: forall (t4 :: Type). ((t4 :: Type) -> Type) -> (t4 :: Type) -> Type +WrapNoFoldable :: forall (t10 :: Type). ((t10 :: Type) -> Type) -> (t10 :: Type) -> Type Data Wrap @@ -25,8 +31,8 @@ Wrap = [Representational, Nominal] WrapNoFoldable = [Representational, Nominal] Derived -derive Foldable &0 => Foldable (Wrap @Type &0 :: Type -> Type) -derive Foldable (WrapNoFoldable @Type &0 :: Type -> Type) +derive Foldable (&0 :: Type -> Type) => Foldable (Wrap @Type (&0 :: Type -> Type) :: Type -> Type) +derive Foldable (WrapNoFoldable @Type (&0 :: Type -> Type) :: Type -> Type) Errors -NoInstanceFound { Foldable &0 } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Foldable (&0 :: Type -> Type) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/160_derive_bifoldable_simple/Main.snap b/tests-integration/fixtures/checking/160_derive_bifoldable_simple/Main.snap index ef2d2efb..ad951a85 100644 --- a/tests-integration/fixtures/checking/160_derive_bifoldable_simple/Main.snap +++ b/tests-integration/fixtures/checking/160_derive_bifoldable_simple/Main.snap @@ -3,16 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b -Pair :: forall (a :: Type) (b :: Type). a -> b -> Pair a b +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) +Pair :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Pair (a :: Type) (b :: Type) Const2 :: - forall (t5 :: Type) (t6 :: Type) (e :: Type) (a :: t5) (b :: t6). e -> Const2 @t5 @t6 e a b + forall (t5 :: Type) (t6 :: Type) (e :: Type) (a :: (t5 :: Type)) (b :: (t6 :: Type)). + (e :: Type) -> + Const2 @(t5 :: Type) @(t6 :: Type) (e :: Type) (a :: (t5 :: Type)) (b :: (t6 :: Type)) Types Either :: Type -> Type -> Type Pair :: Type -> Type -> Type -Const2 :: forall (t5 :: Type) (t6 :: Type). Type -> t5 -> t6 -> Type +Const2 :: forall (t5 :: Type) (t6 :: Type). Type -> (t5 :: Type) -> (t6 :: Type) -> Type Data Either @@ -36,4 +38,4 @@ Const2 = [Representational, Phantom, Phantom] Derived derive Bifoldable (Either :: Type -> Type -> Type) derive Bifoldable (Pair :: Type -> Type -> Type) -derive Bifoldable (Const2 @Type @Type &0 :: Type -> Type -> Type) +derive Bifoldable (Const2 @Type @Type (&0 :: Type) :: Type -> Type -> Type) diff --git a/tests-integration/fixtures/checking/161_derive_bifoldable_higher_kinded/Main.snap b/tests-integration/fixtures/checking/161_derive_bifoldable_higher_kinded/Main.snap index d9b8fc33..5e87e9c1 100644 --- a/tests-integration/fixtures/checking/161_derive_bifoldable_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/161_derive_bifoldable_higher_kinded/Main.snap @@ -4,16 +4,33 @@ expression: report --- Terms WrapBoth :: - forall (t6 :: Type) (t10 :: Type) (f :: t6 -> Type) (g :: t10 -> Type) (a :: t6) (b :: t10). - f a -> g b -> WrapBoth @t6 @t10 f g a b + forall (t6 :: Type) (t10 :: Type) (f :: (t6 :: Type) -> Type) (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) (b :: (t10 :: Type)). + (f :: (t6 :: Type) -> Type) (a :: (t6 :: Type)) -> + (g :: (t10 :: Type) -> Type) (b :: (t10 :: Type)) -> + WrapBoth @(t6 :: Type) @(t10 :: Type) + (f :: (t6 :: Type) -> Type) + (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) + (b :: (t10 :: Type)) WrapBothNoConstraint :: - forall (t18 :: Type) (t22 :: Type) (f :: t18 -> Type) (g :: t22 -> Type) (a :: t18) (b :: t22). - f a -> g b -> WrapBothNoConstraint @t18 @t22 f g a b + forall (t18 :: Type) (t22 :: Type) (f :: (t18 :: Type) -> Type) (g :: (t22 :: Type) -> Type) + (a :: (t18 :: Type)) (b :: (t22 :: Type)). + (f :: (t18 :: Type) -> Type) (a :: (t18 :: Type)) -> + (g :: (t22 :: Type) -> Type) (b :: (t22 :: Type)) -> + WrapBothNoConstraint @(t18 :: Type) @(t22 :: Type) + (f :: (t18 :: Type) -> Type) + (g :: (t22 :: Type) -> Type) + (a :: (t18 :: Type)) + (b :: (t22 :: Type)) Types -WrapBoth :: forall (t6 :: Type) (t10 :: Type). (t6 -> Type) -> (t10 -> Type) -> t6 -> t10 -> Type +WrapBoth :: + forall (t6 :: Type) (t10 :: Type). + ((t6 :: Type) -> Type) -> ((t10 :: Type) -> Type) -> (t6 :: Type) -> (t10 :: Type) -> Type WrapBothNoConstraint :: - forall (t18 :: Type) (t22 :: Type). (t18 -> Type) -> (t22 -> Type) -> t18 -> t22 -> Type + forall (t18 :: Type) (t22 :: Type). + ((t18 :: Type) -> Type) -> ((t22 :: Type) -> Type) -> (t18 :: Type) -> (t22 :: Type) -> Type Data WrapBoth @@ -30,9 +47,9 @@ WrapBoth = [Representational, Representational, Nominal, Nominal] WrapBothNoConstraint = [Representational, Representational, Nominal, Nominal] Derived -derive (Foldable &0, Foldable &1) => Bifoldable (WrapBoth @Type @Type &0 &1 :: Type -> Type -> Type) -derive Bifoldable (WrapBothNoConstraint @Type @Type &0 &1 :: Type -> Type -> Type) +derive (Foldable (&0 :: Type -> Type), Foldable (&1 :: Type -> Type)) => Bifoldable (WrapBoth @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) +derive Bifoldable (WrapBothNoConstraint @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) Errors -NoInstanceFound { Foldable &0 } at [TermDeclaration(Idx::(3))] -NoInstanceFound { Foldable &1 } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Foldable (&0 :: Type -> Type) } at [TermDeclaration(Idx::(3))] +NoInstanceFound { Foldable (&1 :: Type -> Type) } at [TermDeclaration(Idx::(3))] diff --git a/tests-integration/fixtures/checking/162_derive_traversable_simple/Main.snap b/tests-integration/fixtures/checking/162_derive_traversable_simple/Main.snap index eb4c896c..f21c15a2 100644 --- a/tests-integration/fixtures/checking/162_derive_traversable_simple/Main.snap +++ b/tests-integration/fixtures/checking/162_derive_traversable_simple/Main.snap @@ -3,15 +3,17 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Identity :: forall (a :: Type). a -> Identity a -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a -Const :: forall (t3 :: Type) (e :: Type) (a :: t3). e -> Const @t3 e a +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +Const :: + forall (t3 :: Type) (e :: Type) (a :: (t3 :: Type)). + (e :: Type) -> Const @(t3 :: Type) (e :: Type) (a :: (t3 :: Type)) Types Identity :: Type -> Type Maybe :: Type -> Type -Const :: forall (t3 :: Type). Type -> t3 -> Type +Const :: forall (t3 :: Type). Type -> (t3 :: Type) -> Type Data Identity @@ -39,6 +41,6 @@ derive Traversable (Identity :: Type -> Type) derive Functor (Maybe :: Type -> Type) derive Foldable (Maybe :: Type -> Type) derive Traversable (Maybe :: Type -> Type) -derive Functor (Const @Type &0 :: Type -> Type) -derive Foldable (Const @Type &0 :: Type -> Type) -derive Traversable (Const @Type &0 :: Type -> Type) +derive Functor (Const @Type (&0 :: Type) :: Type -> Type) +derive Foldable (Const @Type (&0 :: Type) :: Type -> Type) +derive Traversable (Const @Type (&0 :: Type) :: Type -> Type) diff --git a/tests-integration/fixtures/checking/163_derive_traversable_higher_kinded/Main.snap b/tests-integration/fixtures/checking/163_derive_traversable_higher_kinded/Main.snap index 8493bfee..52ca615b 100644 --- a/tests-integration/fixtures/checking/163_derive_traversable_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/163_derive_traversable_higher_kinded/Main.snap @@ -4,11 +4,18 @@ expression: report --- Terms Compose :: - forall (t5 :: Type) (t9 :: Type) (f :: t5 -> Type) (g :: t9 -> t5) (a :: t9). - f (g a) -> Compose @t9 f g a + forall (t5 :: Type) (t9 :: Type) (f :: (t5 :: Type) -> Type) (g :: (t9 :: Type) -> (t5 :: Type)) + (a :: (t9 :: Type)). + (f :: (t5 :: Type) -> Type) ((g :: (t9 :: Type) -> (t5 :: Type)) (a :: (t9 :: Type))) -> + Compose @(t9 :: Type) + (f :: (t5 :: Type) -> Type) + (g :: (t9 :: Type) -> (t5 :: Type)) + (a :: (t9 :: Type)) Types -Compose :: forall (t5 :: Type) (t9 :: Type). (t5 -> Type) -> (t9 -> t5) -> t9 -> Type +Compose :: + forall (t5 :: Type) (t9 :: Type). + ((t5 :: Type) -> Type) -> ((t9 :: Type) -> (t5 :: Type)) -> (t9 :: Type) -> Type Data Compose @@ -20,6 +27,6 @@ Roles Compose = [Representational, Representational, Nominal] Derived -derive (Functor &0, Functor &1) => Functor (Compose @Type @Type &0 &1 :: Type -> Type) -derive (Foldable &0, Foldable &1) => Foldable (Compose @Type @Type &0 &1 :: Type -> Type) -derive (Traversable &0, Traversable &1) => Traversable (Compose @Type @Type &0 &1 :: Type -> Type) +derive (Functor (&0 :: Type -> Type), Functor (&1 :: Type -> Type)) => Functor (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type) +derive (Foldable (&0 :: Type -> Type), Foldable (&1 :: Type -> Type)) => Foldable (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type) +derive (Traversable (&0 :: Type -> Type), Traversable (&1 :: Type -> Type)) => Traversable (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type) diff --git a/tests-integration/fixtures/checking/164_derive_bitraversable_simple/Main.snap b/tests-integration/fixtures/checking/164_derive_bitraversable_simple/Main.snap index 922cf920..be6ab228 100644 --- a/tests-integration/fixtures/checking/164_derive_bitraversable_simple/Main.snap +++ b/tests-integration/fixtures/checking/164_derive_bitraversable_simple/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b -Pair :: forall (a :: Type) (b :: Type). a -> b -> Pair a b +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) +Pair :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Pair (a :: Type) (b :: Type) Types Either :: Type -> Type -> Type diff --git a/tests-integration/fixtures/checking/165_derive_bitraversable_higher_kinded/Main.snap b/tests-integration/fixtures/checking/165_derive_bitraversable_higher_kinded/Main.snap index e5d4e8d8..e3785f03 100644 --- a/tests-integration/fixtures/checking/165_derive_bitraversable_higher_kinded/Main.snap +++ b/tests-integration/fixtures/checking/165_derive_bitraversable_higher_kinded/Main.snap @@ -4,11 +4,20 @@ expression: report --- Terms WrapBoth :: - forall (t6 :: Type) (t10 :: Type) (f :: t6 -> Type) (g :: t10 -> Type) (a :: t6) (b :: t10). - f a -> g b -> WrapBoth @t6 @t10 f g a b + forall (t6 :: Type) (t10 :: Type) (f :: (t6 :: Type) -> Type) (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) (b :: (t10 :: Type)). + (f :: (t6 :: Type) -> Type) (a :: (t6 :: Type)) -> + (g :: (t10 :: Type) -> Type) (b :: (t10 :: Type)) -> + WrapBoth @(t6 :: Type) @(t10 :: Type) + (f :: (t6 :: Type) -> Type) + (g :: (t10 :: Type) -> Type) + (a :: (t6 :: Type)) + (b :: (t10 :: Type)) Types -WrapBoth :: forall (t6 :: Type) (t10 :: Type). (t6 -> Type) -> (t10 -> Type) -> t6 -> t10 -> Type +WrapBoth :: + forall (t6 :: Type) (t10 :: Type). + ((t6 :: Type) -> Type) -> ((t10 :: Type) -> Type) -> (t6 :: Type) -> (t10 :: Type) -> Type Data WrapBoth @@ -20,6 +29,6 @@ Roles WrapBoth = [Representational, Representational, Nominal, Nominal] Derived -derive (Functor &0, Functor &1) => Bifunctor (WrapBoth @Type @Type &0 &1 :: Type -> Type -> Type) -derive (Foldable &0, Foldable &1) => Bifoldable (WrapBoth @Type @Type &0 &1 :: Type -> Type -> Type) -derive (Traversable &0, Traversable &1) => Bitraversable (WrapBoth @Type @Type &0 &1 :: Type -> Type -> Type) +derive (Functor (&0 :: Type -> Type), Functor (&1 :: Type -> Type)) => Bifunctor (WrapBoth @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) +derive (Foldable (&0 :: Type -> Type), Foldable (&1 :: Type -> Type)) => Bifoldable (WrapBoth @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) +derive (Traversable (&0 :: Type -> Type), Traversable (&1 :: Type -> Type)) => Bitraversable (WrapBoth @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type -> Type) diff --git a/tests-integration/fixtures/checking/166_derive_traversable_missing_superclass/Main.snap b/tests-integration/fixtures/checking/166_derive_traversable_missing_superclass/Main.snap index b734c3c8..08521005 100644 --- a/tests-integration/fixtures/checking/166_derive_traversable_missing_superclass/Main.snap +++ b/tests-integration/fixtures/checking/166_derive_traversable_missing_superclass/Main.snap @@ -4,11 +4,18 @@ expression: report --- Terms Compose :: - forall (t5 :: Type) (t9 :: Type) (f :: t5 -> Type) (g :: t9 -> t5) (a :: t9). - f (g a) -> Compose @t9 f g a + forall (t5 :: Type) (t9 :: Type) (f :: (t5 :: Type) -> Type) (g :: (t9 :: Type) -> (t5 :: Type)) + (a :: (t9 :: Type)). + (f :: (t5 :: Type) -> Type) ((g :: (t9 :: Type) -> (t5 :: Type)) (a :: (t9 :: Type))) -> + Compose @(t9 :: Type) + (f :: (t5 :: Type) -> Type) + (g :: (t9 :: Type) -> (t5 :: Type)) + (a :: (t9 :: Type)) Types -Compose :: forall (t5 :: Type) (t9 :: Type). (t5 -> Type) -> (t9 -> t5) -> t9 -> Type +Compose :: + forall (t5 :: Type) (t9 :: Type). + ((t5 :: Type) -> Type) -> ((t9 :: Type) -> (t5 :: Type)) -> (t9 :: Type) -> Type Data Compose @@ -20,8 +27,8 @@ Roles Compose = [Representational, Representational, Nominal] Derived -derive (Traversable &0, Traversable &1) => Traversable (Compose @Type @Type &0 &1 :: Type -> Type) +derive (Traversable (&0 :: Type -> Type), Traversable (&1 :: Type -> Type)) => Traversable (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type) Errors -NoInstanceFound { Functor (Compose @Type @Type &0 &1) } at [TermDeclaration(Idx::(1))] -NoInstanceFound { Foldable (Compose @Type @Type &0 &1) } at [TermDeclaration(Idx::(1))] +NoInstanceFound { Functor (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type)) } at [TermDeclaration(Idx::(1))] +NoInstanceFound { Foldable (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type)) } at [TermDeclaration(Idx::(1))] diff --git a/tests-integration/fixtures/checking/167_derive_eq_1/Main.snap b/tests-integration/fixtures/checking/167_derive_eq_1/Main.snap index 4b36ecd6..889e3cf9 100644 --- a/tests-integration/fixtures/checking/167_derive_eq_1/Main.snap +++ b/tests-integration/fixtures/checking/167_derive_eq_1/Main.snap @@ -3,25 +3,35 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Id :: forall (a :: Type). a -> Id a -Pair :: forall (a :: Type). a -> a -> Pair a -Mixed :: forall (a :: Type). Int -> a -> Boolean -> Mixed a -Rec :: forall (a :: Type). { count :: Int, value :: a } -> Rec a -Wrap :: forall (t9 :: Type) (f :: t9 -> Type) (a :: t9). f a -> Wrap @t9 f a +Id :: forall (a :: Type). (a :: Type) -> Id (a :: Type) +Pair :: forall (a :: Type). (a :: Type) -> (a :: Type) -> Pair (a :: Type) +Mixed :: forall (a :: Type). Int -> (a :: Type) -> Boolean -> Mixed (a :: Type) +Rec :: forall (a :: Type). { count :: Int, value :: (a :: Type) } -> Rec (a :: Type) +Wrap :: + forall (t9 :: Type) (f :: (t9 :: Type) -> Type) (a :: (t9 :: Type)). + (f :: (t9 :: Type) -> Type) (a :: (t9 :: Type)) -> + Wrap @(t9 :: Type) (f :: (t9 :: Type) -> Type) (a :: (t9 :: Type)) Compose :: - forall (t16 :: Type) (t20 :: Type) (f :: t16 -> Type) (g :: t20 -> t16) (a :: t20). - f (g a) -> Compose @t20 f g a -Left' :: forall (a :: Type). a -> Either' a -Right' :: forall (a :: Type). a -> Either' a -NoEq :: forall (a :: Type). a -> NoEq a + forall (t16 :: Type) (t20 :: Type) (f :: (t16 :: Type) -> Type) + (g :: (t20 :: Type) -> (t16 :: Type)) (a :: (t20 :: Type)). + (f :: (t16 :: Type) -> Type) ((g :: (t20 :: Type) -> (t16 :: Type)) (a :: (t20 :: Type))) -> + Compose @(t20 :: Type) + (f :: (t16 :: Type) -> Type) + (g :: (t20 :: Type) -> (t16 :: Type)) + (a :: (t20 :: Type)) +Left' :: forall (a :: Type). (a :: Type) -> Either' (a :: Type) +Right' :: forall (a :: Type). (a :: Type) -> Either' (a :: Type) +NoEq :: forall (a :: Type). (a :: Type) -> NoEq (a :: Type) Types Id :: Type -> Type Pair :: Type -> Type Mixed :: Type -> Type Rec :: Type -> Type -Wrap :: forall (t9 :: Type). (t9 -> Type) -> t9 -> Type -Compose :: forall (t16 :: Type) (t20 :: Type). (t16 -> Type) -> (t20 -> t16) -> t20 -> Type +Wrap :: forall (t9 :: Type). ((t9 :: Type) -> Type) -> (t9 :: Type) -> Type +Compose :: + forall (t16 :: Type) (t20 :: Type). + ((t16 :: Type) -> Type) -> ((t20 :: Type) -> (t16 :: Type)) -> (t20 :: Type) -> Type Either' :: Type -> Type NoEq :: Type -> Type @@ -70,22 +80,22 @@ Either' = [Representational] NoEq = [Representational] Derived -derive Eq1 &0 => Eq1 (Wrap @Type &0 :: Type -> Type) -derive forall (&0 :: Type). (Eq1 &1, Eq (&2 &3)) => Eq (Compose @Type @&0 &1 &2 &3 :: Type) -derive Eq1 &0 => Eq1 (Compose @Type @Type &0 &1 :: Type -> Type) -derive Eq &0 => Eq (Id &0 :: Type) -derive Eq &0 => Eq (Either' &0 :: Type) +derive Eq1 (&0 :: Type -> Type) => Eq1 (Wrap @Type (&0 :: Type -> Type) :: Type -> Type) +derive forall (&0 :: Type). (Eq1 (&1 :: Type -> Type), Eq ((&2 :: (&0 :: Type) -> Type) (&3 :: (&0 :: Type)))) => Eq (Compose @Type @(&0 :: Type) (&1 :: Type -> Type) (&2 :: (&0 :: Type) -> Type) (&3 :: (&0 :: Type)) :: Type) +derive Eq1 (&0 :: Type -> Type) => Eq1 (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type) +derive Eq (&0 :: Type) => Eq (Id (&0 :: Type) :: Type) +derive Eq (&0 :: Type) => Eq (Either' (&0 :: Type) :: Type) derive Eq1 (Either' :: Type -> Type) derive Eq1 (NoEq :: Type -> Type) derive Eq1 (Id :: Type -> Type) -derive Eq &0 => Eq (Pair &0 :: Type) +derive Eq (&0 :: Type) => Eq (Pair (&0 :: Type) :: Type) derive Eq1 (Pair :: Type -> Type) -derive Eq &0 => Eq (Mixed &0 :: Type) +derive Eq (&0 :: Type) => Eq (Mixed (&0 :: Type) :: Type) derive Eq1 (Mixed :: Type -> Type) -derive Eq &0 => Eq (Rec &0 :: Type) +derive Eq (&0 :: Type) => Eq (Rec (&0 :: Type) :: Type) derive Eq1 (Rec :: Type -> Type) -derive (Eq1 &0, Eq &1) => Eq (Wrap @Type &0 &1 :: Type) +derive (Eq1 (&0 :: Type -> Type), Eq (&1 :: Type)) => Eq (Wrap @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) Errors -NoInstanceFound { Eq (&1 ~&2) } at [TermDeclaration(Idx::(17))] -NoInstanceFound { Eq (NoEq ~&0) } at [TermDeclaration(Idx::(23))] +NoInstanceFound { Eq ((&1 :: Type -> Type) (~&2 :: Type)) } at [TermDeclaration(Idx::(17))] +NoInstanceFound { Eq (NoEq (~&0 :: Type)) } at [TermDeclaration(Idx::(23))] diff --git a/tests-integration/fixtures/checking/168_derive_ord_1/Main.snap b/tests-integration/fixtures/checking/168_derive_ord_1/Main.snap index 5e0d4172..60e8c712 100644 --- a/tests-integration/fixtures/checking/168_derive_ord_1/Main.snap +++ b/tests-integration/fixtures/checking/168_derive_ord_1/Main.snap @@ -3,17 +3,27 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Id :: forall (a :: Type). a -> Id a -Wrap :: forall (t5 :: Type) (f :: t5 -> Type) (a :: t5). f a -> Wrap @t5 f a +Id :: forall (a :: Type). (a :: Type) -> Id (a :: Type) +Wrap :: + forall (t5 :: Type) (f :: (t5 :: Type) -> Type) (a :: (t5 :: Type)). + (f :: (t5 :: Type) -> Type) (a :: (t5 :: Type)) -> + Wrap @(t5 :: Type) (f :: (t5 :: Type) -> Type) (a :: (t5 :: Type)) Compose :: - forall (t12 :: Type) (t16 :: Type) (f :: t12 -> Type) (g :: t16 -> t12) (a :: t16). - f (g a) -> Compose @t16 f g a -NoOrd :: forall (a :: Type). a -> NoOrd a + forall (t12 :: Type) (t16 :: Type) (f :: (t12 :: Type) -> Type) + (g :: (t16 :: Type) -> (t12 :: Type)) (a :: (t16 :: Type)). + (f :: (t12 :: Type) -> Type) ((g :: (t16 :: Type) -> (t12 :: Type)) (a :: (t16 :: Type))) -> + Compose @(t16 :: Type) + (f :: (t12 :: Type) -> Type) + (g :: (t16 :: Type) -> (t12 :: Type)) + (a :: (t16 :: Type)) +NoOrd :: forall (a :: Type). (a :: Type) -> NoOrd (a :: Type) Types Id :: Type -> Type -Wrap :: forall (t5 :: Type). (t5 -> Type) -> t5 -> Type -Compose :: forall (t12 :: Type) (t16 :: Type). (t12 -> Type) -> (t16 -> t12) -> t16 -> Type +Wrap :: forall (t5 :: Type). ((t5 :: Type) -> Type) -> (t5 :: Type) -> Type +Compose :: + forall (t12 :: Type) (t16 :: Type). + ((t12 :: Type) -> Type) -> ((t16 :: Type) -> (t12 :: Type)) -> (t16 :: Type) -> Type NoOrd :: Type -> Type Data @@ -41,23 +51,23 @@ Compose = [Representational, Representational, Nominal] NoOrd = [Representational] Derived -derive forall (&0 :: Type). (Eq1 &1, Eq (&2 &3)) => Eq (Compose @Type @&0 &1 &2 &3 :: Type) -derive forall (&0 :: Type). (Ord1 &1, Ord (&2 &3)) => Ord (Compose @Type @&0 &1 &2 &3 :: Type) -derive Eq1 &0 => Eq1 (Compose @Type @Type &0 &1 :: Type -> Type) -derive Ord1 &0 => Ord1 (Compose @Type @Type &0 &1 :: Type -> Type) -derive Eq &0 => Eq (NoOrd &0 :: Type) +derive forall (&0 :: Type). (Eq1 (&1 :: Type -> Type), Eq ((&2 :: (&0 :: Type) -> Type) (&3 :: (&0 :: Type)))) => Eq (Compose @Type @(&0 :: Type) (&1 :: Type -> Type) (&2 :: (&0 :: Type) -> Type) (&3 :: (&0 :: Type)) :: Type) +derive forall (&0 :: Type). (Ord1 (&1 :: Type -> Type), Ord ((&2 :: (&0 :: Type) -> Type) (&3 :: (&0 :: Type)))) => Ord (Compose @Type @(&0 :: Type) (&1 :: Type -> Type) (&2 :: (&0 :: Type) -> Type) (&3 :: (&0 :: Type)) :: Type) +derive Eq1 (&0 :: Type -> Type) => Eq1 (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type) +derive Ord1 (&0 :: Type -> Type) => Ord1 (Compose @Type @Type (&0 :: Type -> Type) (&1 :: Type -> Type) :: Type -> Type) +derive Eq (&0 :: Type) => Eq (NoOrd (&0 :: Type) :: Type) derive Eq1 (NoOrd :: Type -> Type) derive Ord1 (NoOrd :: Type -> Type) -derive Eq &0 => Eq (Id &0 :: Type) +derive Eq (&0 :: Type) => Eq (Id (&0 :: Type) :: Type) derive Eq1 (Id :: Type -> Type) -derive Ord &0 => Ord (Id &0 :: Type) +derive Ord (&0 :: Type) => Ord (Id (&0 :: Type) :: Type) derive Ord1 (Id :: Type -> Type) -derive (Eq1 &0, Eq &1) => Eq (Wrap @Type &0 &1 :: Type) -derive Eq1 &0 => Eq1 (Wrap @Type &0 :: Type -> Type) -derive (Ord1 &0, Ord &1) => Ord (Wrap @Type &0 &1 :: Type) -derive Ord1 &0 => Ord1 (Wrap @Type &0 :: Type -> Type) +derive (Eq1 (&0 :: Type -> Type), Eq (&1 :: Type)) => Eq (Wrap @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) +derive Eq1 (&0 :: Type -> Type) => Eq1 (Wrap @Type (&0 :: Type -> Type) :: Type -> Type) +derive (Ord1 (&0 :: Type -> Type), Ord (&1 :: Type)) => Ord (Wrap @Type (&0 :: Type -> Type) (&1 :: Type) :: Type) +derive Ord1 (&0 :: Type -> Type) => Ord1 (Wrap @Type (&0 :: Type -> Type) :: Type -> Type) Errors -NoInstanceFound { Eq (&1 ~&2) } at [TermDeclaration(Idx::(13))] -NoInstanceFound { Ord (&1 ~&2) } at [TermDeclaration(Idx::(14))] -NoInstanceFound { Ord (NoOrd ~&0) } at [TermDeclaration(Idx::(18))] +NoInstanceFound { Eq ((&1 :: Type -> Type) (~&2 :: Type)) } at [TermDeclaration(Idx::(13))] +NoInstanceFound { Ord ((&1 :: Type -> Type) (~&2 :: Type)) } at [TermDeclaration(Idx::(14))] +NoInstanceFound { Ord (NoOrd (~&0 :: Type)) } at [TermDeclaration(Idx::(18))] diff --git a/tests-integration/fixtures/checking/170_derive_newtype_class_parameterized/Main.snap b/tests-integration/fixtures/checking/170_derive_newtype_class_parameterized/Main.snap index d292637b..54ed7909 100644 --- a/tests-integration/fixtures/checking/170_derive_newtype_class_parameterized/Main.snap +++ b/tests-integration/fixtures/checking/170_derive_newtype_class_parameterized/Main.snap @@ -3,7 +3,7 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Wrapper :: forall (a :: Type). a -> Wrapper a +Wrapper :: forall (a :: Type). (a :: Type) -> Wrapper (a :: Type) Types Wrapper :: Type -> Type @@ -18,4 +18,4 @@ Roles Wrapper = [Representational] Derived -derive Newtype (Wrapper &0 :: Type) (&0 :: Type) +derive Newtype (Wrapper (&0 :: Type) :: Type) ((&0 :: Type) :: Type) diff --git a/tests-integration/fixtures/checking/172_derive_generic_simple/Main.snap b/tests-integration/fixtures/checking/172_derive_generic_simple/Main.snap index 57b576fa..af6963ca 100644 --- a/tests-integration/fixtures/checking/172_derive_generic_simple/Main.snap +++ b/tests-integration/fixtures/checking/172_derive_generic_simple/Main.snap @@ -4,28 +4,40 @@ expression: report --- Terms MyUnit :: MyUnit -Identity :: forall (a :: Type). a -> Identity a -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b -Tuple :: forall (a :: Type) (b :: Type). a -> b -> Tuple a b -Wrapper :: forall (a :: Type). a -> Wrapper a -Proxy :: forall (t6 :: Type) (a :: t6). Proxy @t6 a -getVoid :: forall (rep :: Type). Generic Void rep => Proxy @Type rep -getMyUnit :: forall (rep :: Type). Generic MyUnit rep => Proxy @Type rep -getIdentity :: forall (a :: Type) (rep :: Type). Generic (Identity a) rep => Proxy @Type rep +Identity :: forall (a :: Type). (a :: Type) -> Identity (a :: Type) +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) +Tuple :: forall (a :: Type) (b :: Type). (a :: Type) -> (b :: Type) -> Tuple (a :: Type) (b :: Type) +Wrapper :: forall (a :: Type). (a :: Type) -> Wrapper (a :: Type) +Proxy :: forall (t6 :: Type) (a :: (t6 :: Type)). Proxy @(t6 :: Type) (a :: (t6 :: Type)) +getVoid :: forall (rep :: Type). Generic Void (rep :: Type) => Proxy @Type (rep :: Type) +getMyUnit :: forall (rep :: Type). Generic MyUnit (rep :: Type) => Proxy @Type (rep :: Type) +getIdentity :: + forall (a :: Type) (rep :: Type). + Generic (Identity (a :: Type)) (rep :: Type) => Proxy @Type (rep :: Type) getEither :: - forall (a :: Type) (b :: Type) (rep :: Type). Generic (Either a b) rep => Proxy @Type rep -getTuple :: forall (a :: Type) (b :: Type) (rep :: Type). Generic (Tuple a b) rep => Proxy @Type rep -getWrapper :: forall (a :: Type) (rep :: Type). Generic (Wrapper a) rep => Proxy @Type rep + forall (a :: Type) (b :: Type) (rep :: Type). + Generic (Either (a :: Type) (b :: Type)) (rep :: Type) => Proxy @Type (rep :: Type) +getTuple :: + forall (a :: Type) (b :: Type) (rep :: Type). + Generic (Tuple (a :: Type) (b :: Type)) (rep :: Type) => Proxy @Type (rep :: Type) +getWrapper :: + forall (a :: Type) (rep :: Type). + Generic (Wrapper (a :: Type)) (rep :: Type) => Proxy @Type (rep :: Type) forceSolve :: forall (t65 :: Type) (t67 :: Type) (t68 :: Type) (t70 :: Type) (t71 :: Type) (t73 :: Type). { getEither :: - Proxy @Type (Sum (Constructor "Left" (Argument t67)) (Constructor "Right" (Argument t68))) - , getIdentity :: Proxy @Type (Constructor "Identity" (Argument t65)) + Proxy @Type + (Sum + (Constructor "Left" (Argument (t67 :: Type))) + (Constructor "Right" (Argument (t68 :: Type)))) + , getIdentity :: Proxy @Type (Constructor "Identity" (Argument (t65 :: Type))) , getMyUnit :: Proxy @Type (Constructor "MyUnit" NoArguments) - , getTuple :: Proxy @Type (Constructor "Tuple" (Product (Argument t70) (Argument t71))) + , getTuple :: + Proxy @Type + (Constructor "Tuple" (Product (Argument (t70 :: Type)) (Argument (t71 :: Type)))) , getVoid :: Proxy @Type NoConstructors - , getWrapper :: Proxy @Type (Constructor "Wrapper" (Argument t73)) + , getWrapper :: Proxy @Type (Constructor "Wrapper" (Argument (t73 :: Type))) } Types @@ -35,7 +47,7 @@ Identity :: Type -> Type Either :: Type -> Type -> Type Tuple :: Type -> Type -> Type Wrapper :: Type -> Type -Proxy :: forall (t6 :: Type). t6 -> Type +Proxy :: forall (t6 :: Type). (t6 :: Type) -> Type Data Void @@ -79,7 +91,7 @@ Proxy = [Phantom] Derived derive Generic (Void :: Type) (NoConstructors :: Type) derive Generic (MyUnit :: Type) (Constructor "MyUnit" NoArguments :: Type) -derive Generic (Identity &0 :: Type) (Constructor "Identity" (Argument &0) :: Type) -derive Generic (Either &0 &1 :: Type) (Sum (Constructor "Left" (Argument &0)) (Constructor "Right" (Argument &1)) :: Type) -derive Generic (Tuple &0 &1 :: Type) (Constructor "Tuple" (Product (Argument &0) (Argument &1)) :: Type) -derive Generic (Wrapper &0 :: Type) (Constructor "Wrapper" (Argument &0) :: Type) +derive Generic (Identity (&0 :: Type) :: Type) (Constructor "Identity" (Argument (&0 :: Type)) :: Type) +derive Generic (Either (&0 :: Type) (&1 :: Type) :: Type) (Sum (Constructor "Left" (Argument (&0 :: Type))) (Constructor "Right" (Argument (&1 :: Type))) :: Type) +derive Generic (Tuple (&0 :: Type) (&1 :: Type) :: Type) (Constructor "Tuple" (Product (Argument (&0 :: Type)) (Argument (&1 :: Type))) :: Type) +derive Generic (Wrapper (&0 :: Type) :: Type) (Constructor "Wrapper" (Argument (&0 :: Type)) :: Type) diff --git a/tests-integration/fixtures/checking/173_derive_newtype_class_coercible/Main.snap b/tests-integration/fixtures/checking/173_derive_newtype_class_coercible/Main.snap index 780692ee..0ff2c93d 100644 --- a/tests-integration/fixtures/checking/173_derive_newtype_class_coercible/Main.snap +++ b/tests-integration/fixtures/checking/173_derive_newtype_class_coercible/Main.snap @@ -6,9 +6,9 @@ Terms UserId :: Int -> UserId wrapUserId :: Int -> UserId unwrapUserId :: UserId -> Int -Wrapper :: forall (a :: Type). a -> Wrapper a -wrapWrapper :: forall (a :: Type). a -> Wrapper a -unwrapWrapper :: forall (a :: Type). Wrapper a -> a +Wrapper :: forall (a :: Type). (a :: Type) -> Wrapper (a :: Type) +wrapWrapper :: forall (a :: Type). (a :: Type) -> Wrapper (a :: Type) +unwrapWrapper :: forall (a :: Type). Wrapper (a :: Type) -> (a :: Type) Types UserId :: Type @@ -30,4 +30,4 @@ Wrapper = [Representational] Derived derive Newtype (UserId :: Type) (Int :: Type) -derive Newtype (Wrapper &0 :: Type) (&0 :: Type) +derive Newtype (Wrapper (&0 :: Type) :: Type) ((&0 :: Type) :: Type) diff --git a/tests-integration/fixtures/checking/174_role_inference_phantom/Main.snap b/tests-integration/fixtures/checking/174_role_inference_phantom/Main.snap index 22188897..8c23bb30 100644 --- a/tests-integration/fixtures/checking/174_role_inference_phantom/Main.snap +++ b/tests-integration/fixtures/checking/174_role_inference_phantom/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (t0 :: Type) (a :: t0). Proxy @t0 a +Proxy :: forall (t0 :: Type) (a :: (t0 :: Type)). Proxy @(t0 :: Type) (a :: (t0 :: Type)) Types -Proxy :: forall (t0 :: Type). t0 -> Type +Proxy :: forall (t0 :: Type). (t0 :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/175_role_inference_representational/Main.snap b/tests-integration/fixtures/checking/175_role_inference_representational/Main.snap index c5235b8c..c4ef64c6 100644 --- a/tests-integration/fixtures/checking/175_role_inference_representational/Main.snap +++ b/tests-integration/fixtures/checking/175_role_inference_representational/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) Types Maybe :: Type -> Type diff --git a/tests-integration/fixtures/checking/176_role_inference_nominal_constraint/Main.snap b/tests-integration/fixtures/checking/176_role_inference_nominal_constraint/Main.snap index 4589da61..c6ca57a0 100644 --- a/tests-integration/fixtures/checking/176_role_inference_nominal_constraint/Main.snap +++ b/tests-integration/fixtures/checking/176_role_inference_nominal_constraint/Main.snap @@ -3,8 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -show :: forall (a :: Type). Show a => a -> String -Shown :: forall (a :: Type). ((Show a => a -> String) -> String) -> Shown a +show :: forall (a :: Type). Show (a :: Type) => (a :: Type) -> String +Shown :: + forall (a :: Type). ((Show (a :: Type) => (a :: Type) -> String) -> String) -> Shown (a :: Type) Types Show :: Type -> Constraint diff --git a/tests-integration/fixtures/checking/177_role_inference_nominal_parametric/Main.snap b/tests-integration/fixtures/checking/177_role_inference_nominal_parametric/Main.snap index 85741f64..61029aeb 100644 --- a/tests-integration/fixtures/checking/177_role_inference_nominal_parametric/Main.snap +++ b/tests-integration/fixtures/checking/177_role_inference_nominal_parametric/Main.snap @@ -3,10 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -F :: forall (t4 :: Type) (f :: t4 -> Type) (a :: t4). f a -> F @t4 f a +F :: + forall (t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)). + (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) -> + F @(t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) Types -F :: forall (t4 :: Type). (t4 -> Type) -> t4 -> Type +F :: forall (t4 :: Type). ((t4 :: Type) -> Type) -> (t4 :: Type) -> Type Data F diff --git a/tests-integration/fixtures/checking/178_role_inference_nested/Main.snap b/tests-integration/fixtures/checking/178_role_inference_nested/Main.snap index 605c0358..a1f11a84 100644 --- a/tests-integration/fixtures/checking/178_role_inference_nested/Main.snap +++ b/tests-integration/fixtures/checking/178_role_inference_nested/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a -First :: forall (a :: Type). Maybe a -> First a +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +First :: forall (a :: Type). Maybe (a :: Type) -> First (a :: Type) Types Maybe :: Type -> Type diff --git a/tests-integration/fixtures/checking/179_role_inference_recursive/Main.snap b/tests-integration/fixtures/checking/179_role_inference_recursive/Main.snap index 4016bb24..cfbfec32 100644 --- a/tests-integration/fixtures/checking/179_role_inference_recursive/Main.snap +++ b/tests-integration/fixtures/checking/179_role_inference_recursive/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nil :: forall (a :: Type). List a -Cons :: forall (a :: Type). a -> List a -> List a +Nil :: forall (a :: Type). List (a :: Type) +Cons :: forall (a :: Type). (a :: Type) -> List (a :: Type) -> List (a :: Type) Types List :: Type -> Type diff --git a/tests-integration/fixtures/checking/180_role_declaration_strengthen/Main.snap b/tests-integration/fixtures/checking/180_role_declaration_strengthen/Main.snap index d9555a9e..350215ca 100644 --- a/tests-integration/fixtures/checking/180_role_declaration_strengthen/Main.snap +++ b/tests-integration/fixtures/checking/180_role_declaration_strengthen/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) Types Maybe :: Type -> Type diff --git a/tests-integration/fixtures/checking/181_role_declaration_loosen_error/Main.snap b/tests-integration/fixtures/checking/181_role_declaration_loosen_error/Main.snap index 6c7f82d0..ddbd408c 100644 --- a/tests-integration/fixtures/checking/181_role_declaration_loosen_error/Main.snap +++ b/tests-integration/fixtures/checking/181_role_declaration_loosen_error/Main.snap @@ -3,10 +3,13 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -F :: forall (t4 :: Type) (f :: t4 -> Type) (a :: t4). f a -> F @t4 f a +F :: + forall (t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)). + (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) -> + F @(t4 :: Type) (f :: (t4 :: Type) -> Type) (a :: (t4 :: Type)) Types -F :: forall (t4 :: Type). (t4 -> Type) -> t4 -> Type +F :: forall (t4 :: Type). ((t4 :: Type) -> Type) -> (t4 :: Type) -> Type Data F diff --git a/tests-integration/fixtures/checking/183_coercible_reflexivity/Main.snap b/tests-integration/fixtures/checking/183_coercible_reflexivity/Main.snap index 9e615ff2..7b1993c8 100644 --- a/tests-integration/fixtures/checking/183_coercible_reflexivity/Main.snap +++ b/tests-integration/fixtures/checking/183_coercible_reflexivity/Main.snap @@ -5,6 +5,6 @@ expression: report Terms testInt :: Int -> Int testString :: String -> String -testPoly :: forall (a :: Type). a -> a +testPoly :: forall (a :: Type). (a :: Type) -> (a :: Type) Types diff --git a/tests-integration/fixtures/checking/184_coercible_newtype_wrap/Main.snap b/tests-integration/fixtures/checking/184_coercible_newtype_wrap/Main.snap index 7bd9d00f..6f08ef9b 100644 --- a/tests-integration/fixtures/checking/184_coercible_newtype_wrap/Main.snap +++ b/tests-integration/fixtures/checking/184_coercible_newtype_wrap/Main.snap @@ -6,9 +6,9 @@ Terms Age :: Int -> Age wrapAge :: Int -> Age unwrapAge :: Age -> Int -Wrapper :: forall (a :: Type). a -> Wrapper a -wrapValue :: forall (a :: Type). a -> Wrapper a -unwrapValue :: forall (a :: Type). Wrapper a -> a +Wrapper :: forall (a :: Type). (a :: Type) -> Wrapper (a :: Type) +wrapValue :: forall (a :: Type). (a :: Type) -> Wrapper (a :: Type) +unwrapValue :: forall (a :: Type). Wrapper (a :: Type) -> (a :: Type) Types Age :: Type diff --git a/tests-integration/fixtures/checking/185_coercible_phantom/Main.snap b/tests-integration/fixtures/checking/185_coercible_phantom/Main.snap index d4a9853f..f98cceff 100644 --- a/tests-integration/fixtures/checking/185_coercible_phantom/Main.snap +++ b/tests-integration/fixtures/checking/185_coercible_phantom/Main.snap @@ -3,12 +3,14 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (t0 :: Type) (a :: t0). Proxy @t0 a -coerceProxy :: forall (t4 :: Type) (t6 :: Type) (a :: t4) (b :: t6). Proxy @t4 a -> Proxy @t6 b +Proxy :: forall (t0 :: Type) (a :: (t0 :: Type)). Proxy @(t0 :: Type) (a :: (t0 :: Type)) +coerceProxy :: + forall (t4 :: Type) (t6 :: Type) (a :: (t4 :: Type)) (b :: (t6 :: Type)). + Proxy @(t4 :: Type) (a :: (t4 :: Type)) -> Proxy @(t6 :: Type) (b :: (t6 :: Type)) coerceProxyIntString :: Proxy @Type Int -> Proxy @Type String Types -Proxy :: forall (t0 :: Type). t0 -> Type +Proxy :: forall (t0 :: Type). (t0 :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/186_coercible_representational/Main.snap b/tests-integration/fixtures/checking/186_coercible_representational/Main.snap index 5de52980..f64abfef 100644 --- a/tests-integration/fixtures/checking/186_coercible_representational/Main.snap +++ b/tests-integration/fixtures/checking/186_coercible_representational/Main.snap @@ -3,8 +3,8 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) Age :: Int -> Age coerceMaybe :: Maybe Age -> Maybe Int coerceMaybeReverse :: Maybe Int -> Maybe Age diff --git a/tests-integration/fixtures/checking/189_coercible_different_heads_error/Main.snap b/tests-integration/fixtures/checking/189_coercible_different_heads_error/Main.snap index 7aed004b..b269ccaf 100644 --- a/tests-integration/fixtures/checking/189_coercible_different_heads_error/Main.snap +++ b/tests-integration/fixtures/checking/189_coercible_different_heads_error/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) coerceDifferent :: Maybe Int -> Either Int String Types diff --git a/tests-integration/fixtures/checking/197_coercible_higher_kinded_error/Main.snap b/tests-integration/fixtures/checking/197_coercible_higher_kinded_error/Main.snap index 25d52571..541c5dcc 100644 --- a/tests-integration/fixtures/checking/197_coercible_higher_kinded_error/Main.snap +++ b/tests-integration/fixtures/checking/197_coercible_higher_kinded_error/Main.snap @@ -3,10 +3,10 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Nothing :: forall (a :: Type). Maybe a -Just :: forall (a :: Type). a -> Maybe a -Nil :: forall (a :: Type). List a -Cons :: forall (a :: Type). a -> List a -> List a +Nothing :: forall (a :: Type). Maybe (a :: Type) +Just :: forall (a :: Type). (a :: Type) -> Maybe (a :: Type) +Nil :: forall (a :: Type). List (a :: Type) +Cons :: forall (a :: Type). (a :: Type) -> List (a :: Type) -> List (a :: Type) coerceContainerDifferent :: Container Maybe -> Container List Types @@ -30,4 +30,4 @@ List = [Representational] Container = [Representational] Errors -NoInstanceFound { Coercible (Maybe ~&0) (List ~&0) } at [TermDeclaration(Idx::(4))] +NoInstanceFound { Coercible (Maybe (~&0 :: Type)) (List (~&0 :: Type)) } at [TermDeclaration(Idx::(4))] diff --git a/tests-integration/fixtures/checking/198_coercible_higher_kinded_multi/Main.snap b/tests-integration/fixtures/checking/198_coercible_higher_kinded_multi/Main.snap index 0c9438ce..d01ee756 100644 --- a/tests-integration/fixtures/checking/198_coercible_higher_kinded_multi/Main.snap +++ b/tests-integration/fixtures/checking/198_coercible_higher_kinded_multi/Main.snap @@ -3,16 +3,18 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Left :: forall (a :: Type) (b :: Type). a -> Either a b -Right :: forall (a :: Type) (b :: Type). b -> Either a b -EitherAlias :: forall (a :: Type) (b :: Type). Either a b -> EitherAlias a b +Left :: forall (a :: Type) (b :: Type). (a :: Type) -> Either (a :: Type) (b :: Type) +Right :: forall (a :: Type) (b :: Type). (b :: Type) -> Either (a :: Type) (b :: Type) +EitherAlias :: + forall (a :: Type) (b :: Type). + Either (a :: Type) (b :: Type) -> EitherAlias (a :: Type) (b :: Type) coerceContainer :: Container @(Type -> Type -> Type) Either -> Container @(Type -> Type -> Type) EitherAlias Types Either :: Type -> Type -> Type EitherAlias :: Type -> Type -> Type -Container :: forall (k :: Type). k -> Type +Container :: forall (k :: Type). (k :: Type) -> Type Data Either diff --git a/tests-integration/fixtures/checking/199_coercible_higher_kinded_polykinded/Main.snap b/tests-integration/fixtures/checking/199_coercible_higher_kinded_polykinded/Main.snap index 7cc42cf1..7f300c09 100644 --- a/tests-integration/fixtures/checking/199_coercible_higher_kinded_polykinded/Main.snap +++ b/tests-integration/fixtures/checking/199_coercible_higher_kinded_polykinded/Main.snap @@ -3,15 +3,22 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Just :: forall (k :: Type) (n :: k) (a :: Type). a -> Maybe @k n a -Nothing :: forall (k :: Type) (n :: k) (a :: Type). Maybe @k n a -MaybeAlias :: forall (k :: Type) (n :: k) (a :: Type). Maybe @k n a -> MaybeAlias @k n a +Just :: + forall (k :: Type) (n :: (k :: Type)) (a :: Type). + (a :: Type) -> Maybe @(k :: Type) (n :: (k :: Type)) (a :: Type) +Nothing :: + forall (k :: Type) (n :: (k :: Type)) (a :: Type). + Maybe @(k :: Type) (n :: (k :: Type)) (a :: Type) +MaybeAlias :: + forall (k :: Type) (n :: (k :: Type)) (a :: Type). + Maybe @(k :: Type) (n :: (k :: Type)) (a :: Type) -> + MaybeAlias @(k :: Type) (n :: (k :: Type)) (a :: Type) coerceContainer :: Container Maybe -> Container MaybeAlias coerceContainerReverse :: Container MaybeAlias -> Container Maybe Types -Maybe :: forall (k :: Type). k -> Type -> Type -MaybeAlias :: forall (k :: Type). k -> Type -> Type +Maybe :: forall (k :: Type). (k :: Type) -> Type -> Type +MaybeAlias :: forall (k :: Type). (k :: Type) -> Type -> Type Container :: (Type -> Type -> Type) -> Type Data diff --git a/tests-integration/fixtures/checking/200_int_compare_transitive/Main.snap b/tests-integration/fixtures/checking/200_int_compare_transitive/Main.snap index a08bad86..262d999d 100644 --- a/tests-integration/fixtures/checking/200_int_compare_transitive/Main.snap +++ b/tests-integration/fixtures/checking/200_int_compare_transitive/Main.snap @@ -3,62 +3,99 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) assertLesser :: - forall (l :: Int) (r :: Int). Compare l r LT => Proxy @(Row Int) ( left :: l, right :: r ) + forall (l :: Int) (r :: Int). + Compare (l :: Int) (r :: Int) LT => Proxy @(Row Int) ( left :: (l :: Int), right :: (r :: Int) ) assertGreater :: - forall (l :: Int) (r :: Int). Compare l r GT => Proxy @(Row Int) ( left :: l, right :: r ) + forall (l :: Int) (r :: Int). + Compare (l :: Int) (r :: Int) GT => Proxy @(Row Int) ( left :: (l :: Int), right :: (r :: Int) ) assertEqual :: - forall (l :: Int) (r :: Int). Compare l r EQ => Proxy @(Row Int) ( left :: l, right :: r ) -symmLt :: forall (m :: Int) (n :: Int). Compare m n GT => Proxy @(Row Int) ( left :: n, right :: m ) -symmGt :: forall (m :: Int) (n :: Int). Compare m n LT => Proxy @(Row Int) ( left :: n, right :: m ) -symmEq :: forall (m :: Int) (n :: Int). Compare m n EQ => Proxy @(Row Int) ( left :: n, right :: m ) -reflEq :: forall (n :: Int). Proxy @(Row Int) ( left :: n, right :: n ) + forall (l :: Int) (r :: Int). + Compare (l :: Int) (r :: Int) EQ => Proxy @(Row Int) ( left :: (l :: Int), right :: (r :: Int) ) +symmLt :: + forall (m :: Int) (n :: Int). + Compare (m :: Int) (n :: Int) GT => Proxy @(Row Int) ( left :: (n :: Int), right :: (m :: Int) ) +symmGt :: + forall (m :: Int) (n :: Int). + Compare (m :: Int) (n :: Int) LT => Proxy @(Row Int) ( left :: (n :: Int), right :: (m :: Int) ) +symmEq :: + forall (m :: Int) (n :: Int). + Compare (m :: Int) (n :: Int) EQ => Proxy @(Row Int) ( left :: (n :: Int), right :: (m :: Int) ) +reflEq :: forall (n :: Int). Proxy @(Row Int) ( left :: (n :: Int), right :: (n :: Int) ) transLt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare m n LT => Compare n p LT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (m :: Int) (n :: Int) LT => + Compare (n :: Int) (p :: Int) LT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transLtEq :: forall (m :: Int) (n :: Int) (p :: Int). - Compare m n LT => Compare n p EQ => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (m :: Int) (n :: Int) LT => + Compare (n :: Int) (p :: Int) EQ => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transEqLt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare m n EQ => Compare n p LT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (m :: Int) (n :: Int) EQ => + Compare (n :: Int) (p :: Int) LT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transGt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare m n GT => Compare n p GT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (m :: Int) (n :: Int) GT => + Compare (n :: Int) (p :: Int) GT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transGtEq :: forall (m :: Int) (n :: Int) (p :: Int). - Compare m n GT => Compare n p EQ => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (m :: Int) (n :: Int) GT => + Compare (n :: Int) (p :: Int) EQ => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transEqGt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare m n EQ => Compare n p GT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (m :: Int) (n :: Int) EQ => + Compare (n :: Int) (p :: Int) GT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transEq :: forall (m :: Int) (n :: Int) (p :: Int). - Compare m n EQ => Compare n p EQ => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (m :: Int) (n :: Int) EQ => + Compare (n :: Int) (p :: Int) EQ => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transSymmLt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare n m GT => Compare n p LT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (n :: Int) (m :: Int) GT => + Compare (n :: Int) (p :: Int) LT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transSymmLtEq :: forall (m :: Int) (n :: Int) (p :: Int). - Compare n m GT => Compare n p EQ => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (n :: Int) (m :: Int) GT => + Compare (n :: Int) (p :: Int) EQ => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transSymmEqLt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare n m EQ => Compare n p LT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (n :: Int) (m :: Int) EQ => + Compare (n :: Int) (p :: Int) LT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transSymmGt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare n m LT => Compare n p GT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (n :: Int) (m :: Int) LT => + Compare (n :: Int) (p :: Int) GT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transSymmGtEq :: forall (m :: Int) (n :: Int) (p :: Int). - Compare n m LT => Compare n p EQ => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (n :: Int) (m :: Int) LT => + Compare (n :: Int) (p :: Int) EQ => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transSymmEqGt :: forall (m :: Int) (n :: Int) (p :: Int). - Compare n m EQ => Compare n p GT => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (n :: Int) (m :: Int) EQ => + Compare (n :: Int) (p :: Int) GT => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) transSymmEq :: forall (m :: Int) (n :: Int) (p :: Int). - Compare n m EQ => Compare n p EQ => Proxy @Int n -> Proxy @(Row Int) ( left :: m, right :: p ) + Compare (n :: Int) (m :: Int) EQ => + Compare (n :: Int) (p :: Int) EQ => + Proxy @Int (n :: Int) -> Proxy @(Row Int) ( left :: (m :: Int), right :: (p :: Int) ) Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/205_builtin_warn/Main.snap b/tests-integration/fixtures/checking/205_builtin_warn/Main.snap index c4c44b38..d4173f18 100644 --- a/tests-integration/fixtures/checking/205_builtin_warn/Main.snap +++ b/tests-integration/fixtures/checking/205_builtin_warn/Main.snap @@ -3,32 +3,40 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a -warnBasic :: forall (a :: Type). Warn (Text "This function is deprecated") => a -> a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) +warnBasic :: + forall (a :: Type). Warn (Text "This function is deprecated") => (a :: Type) -> (a :: Type) useWarnBasic :: Int -warnBeside :: forall (a :: Type). Warn (Beside (Text "Left ") (Text "Right")) => a -> a +warnBeside :: + forall (a :: Type). Warn (Beside (Text "Left ") (Text "Right")) => (a :: Type) -> (a :: Type) useWarnBeside :: Int -warnAbove :: forall (a :: Type). Warn (Above (Text "Line 1") (Text "Line 2")) => a -> a +warnAbove :: + forall (a :: Type). Warn (Above (Text "Line 1") (Text "Line 2")) => (a :: Type) -> (a :: Type) useWarnAbove :: Int warnQuote :: - forall (t10 :: Type) (a :: t10). - Warn (Beside (Text "Got type: ") (Quote @t10 a)) => Proxy @t10 a -> Proxy @t10 a + forall (t10 :: Type) (a :: (t10 :: Type)). + Warn (Beside (Text "Got type: ") (Quote @(t10 :: Type) (a :: (t10 :: Type)))) => + Proxy @(t10 :: Type) (a :: (t10 :: Type)) -> Proxy @(t10 :: Type) (a :: (t10 :: Type)) useWarnQuote :: Proxy @Type Int warnQuoteLabel :: - forall (a :: Type). Warn (Beside (Text "Label: ") (QuoteLabel "myField")) => a -> a + forall (a :: Type). + Warn (Beside (Text "Label: ") (QuoteLabel "myField")) => (a :: Type) -> (a :: Type) useWarnQuoteLabel :: Int warnQuoteLabelSpaces :: - forall (a :: Type). Warn (Beside (Text "Label: ") (QuoteLabel "h e l l o")) => a -> a + forall (a :: Type). + Warn (Beside (Text "Label: ") (QuoteLabel "h e l l o")) => (a :: Type) -> (a :: Type) useWarnQuoteLabelSpaces :: Int warnQuoteLabelQuote :: - forall (a :: Type). Warn (Beside (Text "Label: ") (QuoteLabel "hel\"lo")) => a -> a + forall (a :: Type). + Warn (Beside (Text "Label: ") (QuoteLabel "hel\"lo")) => (a :: Type) -> (a :: Type) useWarnQuoteLabelQuote :: Int warnQuoteLabelRaw :: - forall (a :: Type). Warn (Beside (Text "Label: ") (QuoteLabel """raw\nstring""")) => a -> a + forall (a :: Type). + Warn (Beside (Text "Label: ") (QuoteLabel """raw\nstring""")) => (a :: Type) -> (a :: Type) useWarnQuoteLabelRaw :: Int Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/206_builtin_fail/Main.snap b/tests-integration/fixtures/checking/206_builtin_fail/Main.snap index 586f54b9..559b6812 100644 --- a/tests-integration/fixtures/checking/206_builtin_fail/Main.snap +++ b/tests-integration/fixtures/checking/206_builtin_fail/Main.snap @@ -3,16 +3,19 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -Proxy :: forall (k :: Type) (a :: k). Proxy @k a -failBasic :: forall (a :: Type). Fail (Text "This operation is not allowed") => a -> a +Proxy :: forall (k :: Type) (a :: (k :: Type)). Proxy @(k :: Type) (a :: (k :: Type)) +failBasic :: + forall (a :: Type). Fail (Text "This operation is not allowed") => (a :: Type) -> (a :: Type) useFailBasic :: Int failComplex :: - forall (t8 :: Type) (a :: t8). - Fail (Above (Text "Error:") (Beside (Text "Type ") (Quote @t8 a))) => Proxy @t8 a -> Proxy @t8 a + forall (t8 :: Type) (a :: (t8 :: Type)). + Fail + (Above (Text "Error:") (Beside (Text "Type ") (Quote @(t8 :: Type) (a :: (t8 :: Type))))) => + Proxy @(t8 :: Type) (a :: (t8 :: Type)) -> Proxy @(t8 :: Type) (a :: (t8 :: Type)) useFailComplex :: Proxy @Type String Types -Proxy :: forall (k :: Type). k -> Type +Proxy :: forall (k :: Type). (k :: Type) -> Type Data Proxy diff --git a/tests-integration/fixtures/checking/207_operator_class_method/Main.snap b/tests-integration/fixtures/checking/207_operator_class_method/Main.snap index a5778e2b..a59f0462 100644 --- a/tests-integration/fixtures/checking/207_operator_class_method/Main.snap +++ b/tests-integration/fixtures/checking/207_operator_class_method/Main.snap @@ -3,9 +3,9 @@ source: tests-integration/tests/checking/generated.rs expression: report --- Terms -add :: forall (a :: Type). Semiring a => a -> a -> a +add :: forall (a :: Type). Semiring (a :: Type) => (a :: Type) -> (a :: Type) -> (a :: Type) addImpl :: Int -> Int -> Int -+ :: forall (a :: Type). Semiring a => a -> a -> a ++ :: forall (a :: Type). Semiring (a :: Type) => (a :: Type) -> (a :: Type) -> (a :: Type) test :: Int test' :: Int diff --git a/tests-integration/fixtures/checking/208_int_add_constraint/Main.purs b/tests-integration/fixtures/checking/208_int_add_constraint/Main.purs new file mode 100644 index 00000000..c3ddd5c2 --- /dev/null +++ b/tests-integration/fixtures/checking/208_int_add_constraint/Main.purs @@ -0,0 +1,13 @@ +module Main where + +import Prim.Int (class Add) +import Type.Proxy (Proxy(..)) + +class Program n m + +instance (Add n 1 n1, Add n1 1 n2) => Program n n2 + +add :: forall n m. Program n m => Proxy n -> Proxy m +add _ = Proxy + +test = add (Proxy :: Proxy 1) diff --git a/tests-integration/fixtures/checking/208_int_add_constraint/Main.snap b/tests-integration/fixtures/checking/208_int_add_constraint/Main.snap new file mode 100644 index 00000000..7319bae4 --- /dev/null +++ b/tests-integration/fixtures/checking/208_int_add_constraint/Main.snap @@ -0,0 +1,20 @@ +--- +source: tests-integration/tests/checking/generated.rs +expression: report +--- +Terms +add :: + forall (t9 :: Type) (t11 :: Type) (n :: (t9 :: Type)) (m :: (t11 :: Type)). + Program @(t9 :: Type) @(t11 :: Type) (n :: (t9 :: Type)) (m :: (t11 :: Type)) => + Proxy @(t9 :: Type) (n :: (t9 :: Type)) -> Proxy @(t11 :: Type) (m :: (t11 :: Type)) +test :: Proxy @Int 3 + +Types +Program :: forall (t0 :: Type) (t1 :: Type). (t0 :: Type) -> (t1 :: Type) -> Constraint + +Classes +class Program (&2 :: (&0 :: Type)) (&3 :: (&1 :: Type)) + +Instances +instance (Add (&0 :: Int) 1 (&2 :: Int), Add (&2 :: Int) 1 (&1 :: Int)) => Program ((&0 :: Int) :: Int) ((&1 :: Int) :: Int) + chain: 0 diff --git a/tests-integration/fixtures/checking/209_int_cons_constraint/Main.purs b/tests-integration/fixtures/checking/209_int_cons_constraint/Main.purs new file mode 100644 index 00000000..4ddcf73d --- /dev/null +++ b/tests-integration/fixtures/checking/209_int_cons_constraint/Main.purs @@ -0,0 +1,23 @@ +module Main where + +import Prim.Int (class Add, ToString) +import Prim.Row (class Cons) +import Prim.Symbol (class Append) +import Type.Proxy (Proxy(..)) + +class Build n r | n -> r + +instance Build 0 () +else +instance + ( Add minusOne 1 currentId + , ToString currentId labelId + , Append "n" labelId actualLabel + , Build minusOne minusOneResult + , Cons actualLabel currentId minusOneResult finalResult + ) => Build currentId finalResult + +build :: forall n r. Build n r => Proxy n -> Proxy r +build _ = Proxy + +test = build (Proxy :: Proxy 5) diff --git a/tests-integration/fixtures/checking/209_int_cons_constraint/Main.snap b/tests-integration/fixtures/checking/209_int_cons_constraint/Main.snap new file mode 100644 index 00000000..45072ba0 --- /dev/null +++ b/tests-integration/fixtures/checking/209_int_cons_constraint/Main.snap @@ -0,0 +1,22 @@ +--- +source: tests-integration/tests/checking/generated.rs +expression: report +--- +Terms +build :: + forall (t9 :: Type) (t11 :: Type) (n :: (t9 :: Type)) (r :: (t11 :: Type)). + Build @(t9 :: Type) @(t11 :: Type) (n :: (t9 :: Type)) (r :: (t11 :: Type)) => + Proxy @(t9 :: Type) (n :: (t9 :: Type)) -> Proxy @(t11 :: Type) (r :: (t11 :: Type)) +test :: Proxy @(Row Int) ( n1 :: 1, n2 :: 2, n3 :: 3, n4 :: 4, n5 :: 5 ) + +Types +Build :: forall (t0 :: Type) (t1 :: Type). (t0 :: Type) -> (t1 :: Type) -> Constraint + +Classes +class Build (&2 :: (&0 :: Type)) (&3 :: (&1 :: Type)) + +Instances +instance forall (&0 :: Type). Build (0 :: Int) (() :: Row (&0 :: Type)) + chain: 0 +instance (Add (&2 :: Int) 1 (&0 :: Int), ToString (&0 :: Int) (&3 :: Symbol), Append "n" (&3 :: Symbol) (&4 :: Symbol), Build @Int @(Row Int) (&2 :: Int) (&5 :: Row Int), Cons @Int (&4 :: Symbol) (&0 :: Int) (&5 :: Row Int) (&1 :: Row Int)) => Build ((&0 :: Int) :: Int) ((&1 :: Row Int) :: Row Int) + chain: 1 diff --git a/tests-integration/fixtures/lowering/015_instance_constraints/Main.purs b/tests-integration/fixtures/lowering/015_instance_constraints/Main.purs new file mode 100644 index 00000000..5f8d4c96 --- /dev/null +++ b/tests-integration/fixtures/lowering/015_instance_constraints/Main.purs @@ -0,0 +1,7 @@ +module Main where + +class Bound a b +class Intermediate a b +class Result a b + +instance (Intermediate n m, Result m o) => Bound n o diff --git a/tests-integration/fixtures/lowering/015_instance_constraints/Main.snap b/tests-integration/fixtures/lowering/015_instance_constraints/Main.snap new file mode 100644 index 00000000..75a5dc1a --- /dev/null +++ b/tests-integration/fixtures/lowering/015_instance_constraints/Main.snap @@ -0,0 +1,26 @@ +--- +source: tests-integration/tests/lowering/generated.rs +expression: report +--- +module Main + +Expressions: + + +Types: + +n@Some(Position { line: 6, character: 22 }) + resolves to a constraint variable "n" + Some(Position { line: 6, character: 48 }) +n@Some(Position { line: 6, character: 48 }) + introduces a constraint variable "n" +o@Some(Position { line: 6, character: 36 }) + resolves to a constraint variable "o" + Some(Position { line: 6, character: 50 }) +m@Some(Position { line: 6, character: 24 }) + introduces a constraint variable "m" +o@Some(Position { line: 6, character: 50 }) + introduces a constraint variable "o" +m@Some(Position { line: 6, character: 34 }) + resolves to a constraint variable "m" + Some(Position { line: 6, character: 24 }) diff --git a/tests-integration/fixtures/lowering/016_derive_constraints/Main.purs b/tests-integration/fixtures/lowering/016_derive_constraints/Main.purs new file mode 100644 index 00000000..b8bb6995 --- /dev/null +++ b/tests-integration/fixtures/lowering/016_derive_constraints/Main.purs @@ -0,0 +1,8 @@ +module Main where + +class Bound a b +class Intermediate a b +class Result a b + +derive instance (Intermediate n m, Result m o) => Bound n o + diff --git a/tests-integration/fixtures/lowering/016_derive_constraints/Main.snap b/tests-integration/fixtures/lowering/016_derive_constraints/Main.snap new file mode 100644 index 00000000..82768517 --- /dev/null +++ b/tests-integration/fixtures/lowering/016_derive_constraints/Main.snap @@ -0,0 +1,26 @@ +--- +source: tests-integration/tests/lowering/generated.rs +expression: report +--- +module Main + +Expressions: + + +Types: + +m@Some(Position { line: 6, character: 31 }) + introduces a constraint variable "m" +o@Some(Position { line: 6, character: 57 }) + introduces a constraint variable "o" +m@Some(Position { line: 6, character: 41 }) + resolves to a constraint variable "m" + Some(Position { line: 6, character: 31 }) +n@Some(Position { line: 6, character: 29 }) + resolves to a constraint variable "n" + Some(Position { line: 6, character: 55 }) +n@Some(Position { line: 6, character: 55 }) + introduces a constraint variable "n" +o@Some(Position { line: 6, character: 43 }) + resolves to a constraint variable "o" + Some(Position { line: 6, character: 57 }) diff --git a/tests-integration/tests/checking.rs b/tests-integration/tests/checking.rs index d8036036..66882f22 100644 --- a/tests-integration/tests/checking.rs +++ b/tests-integration/tests/checking.rs @@ -26,14 +26,14 @@ impl<'a> ContextState<'a> { } trait CheckStateExt { - fn bound_variable(&mut self, index: u32) -> TypeId; + fn bound_variable(&mut self, index: u32, kind: TypeId) -> TypeId; fn function(&mut self, argument: TypeId, result: TypeId) -> TypeId; } impl CheckStateExt for CheckState { - fn bound_variable(&mut self, index: u32) -> TypeId { - let var = Variable::Bound(debruijn::Level(index)); + fn bound_variable(&mut self, index: u32, kind: TypeId) -> TypeId { + let var = Variable::Bound(debruijn::Level(index), kind); self.storage.intern(Type::Variable(var)) } @@ -99,8 +99,8 @@ fn test_solve_bound() { unreachable!("invariant violated"); }; - let bound_b = state.bound_variable(0); - let bound_a = state.bound_variable(1); + let bound_b = state.bound_variable(0, context.prim.int); + let bound_a = state.bound_variable(1, context.prim.string); let b_to_a = state.function(bound_b, bound_a); unification::solve(state, context, unification_id, b_to_a).unwrap(); @@ -135,8 +135,8 @@ fn test_solve_invalid() { .type_scope .bind_forall(TypeVariableBindingId::new(FAKE_NONZERO_2), context.prim.string); - let bound_b = state.bound_variable(0); - let bound_a = state.bound_variable(1); + let bound_b = state.bound_variable(0, context.prim.int); + let bound_a = state.bound_variable(1, context.prim.string); let b_to_a = state.function(bound_b, bound_a); state.type_scope.unbind(level); @@ -282,7 +282,7 @@ fn make_forall_a_to_a(context: &CheckContext, state: &mut CheckStat let level = state.type_scope.bind_forall(fake_id, context.prim.t); - let bound_a = state.bound_variable(0); + let bound_a = state.bound_variable(0, context.prim.t); let a_to_a = state.function(bound_a, bound_a); let binder = ForallBinder { visible: false, name: "a".into(), level, kind: context.prim.t }; @@ -346,8 +346,8 @@ fn test_subtype_nested_forall() { let level_b = state.type_scope.bind_forall(TypeVariableBindingId::new(FAKE_NONZERO_2), context.prim.t); - let bound_a = state.bound_variable(1); - let bound_b = state.bound_variable(0); + let bound_a = state.bound_variable(1, context.prim.t); + let bound_b = state.bound_variable(0, context.prim.t); let b_to_a = state.function(bound_b, bound_a); let a_to_b_to_a = state.function(bound_a, b_to_a); diff --git a/tests-integration/tests/checking/generated.rs b/tests-integration/tests/checking/generated.rs index 9c89a209..02b02886 100644 --- a/tests-integration/tests/checking/generated.rs +++ b/tests-integration/tests/checking/generated.rs @@ -425,3 +425,7 @@ fn run_test(folder: &str, file: &str) { #[rustfmt::skip] #[test] fn test_206_builtin_fail_main() { run_test("206_builtin_fail", "Main"); } #[rustfmt::skip] #[test] fn test_207_operator_class_method_main() { run_test("207_operator_class_method", "Main"); } + +#[rustfmt::skip] #[test] fn test_208_int_add_constraint_main() { run_test("208_int_add_constraint", "Main"); } + +#[rustfmt::skip] #[test] fn test_209_int_cons_constraint_main() { run_test("209_int_cons_constraint", "Main"); } diff --git a/tests-integration/tests/lowering/generated.rs b/tests-integration/tests/lowering/generated.rs index 78b6de1e..3eea9006 100644 --- a/tests-integration/tests/lowering/generated.rs +++ b/tests-integration/tests/lowering/generated.rs @@ -39,3 +39,7 @@ fn run_test(folder: &str, file: &str) { #[rustfmt::skip] #[test] fn test_013_ado_statement_let_main() { run_test("013_ado_statement_let", "Main"); } #[rustfmt::skip] #[test] fn test_014_ado_statement_binder_main() { run_test("014_ado_statement_binder", "Main"); } + +#[rustfmt::skip] #[test] fn test_015_instance_constraints_main() { run_test("015_instance_constraints", "Main"); } + +#[rustfmt::skip] #[test] fn test_016_derive_constraints_main() { run_test("016_derive_constraints", "Main"); } diff --git a/tests-integration/tests/snapshots/checking__invalid_type_operator_ternary.snap b/tests-integration/tests/snapshots/checking__invalid_type_operator_ternary.snap index 2cfe121b..9ac2b28c 100644 --- a/tests-integration/tests/snapshots/checking__invalid_type_operator_ternary.snap +++ b/tests-integration/tests/snapshots/checking__invalid_type_operator_ternary.snap @@ -5,7 +5,7 @@ expression: checked.errors [ CheckError { kind: InvalidTypeOperator { - id: Id(47), + id: Id(48), }, step: [], }, diff --git a/tests-integration/tests/snapshots/checking__invalid_type_operator_unary.snap b/tests-integration/tests/snapshots/checking__invalid_type_operator_unary.snap index 6d13e102..dc7c6071 100644 --- a/tests-integration/tests/snapshots/checking__invalid_type_operator_unary.snap +++ b/tests-integration/tests/snapshots/checking__invalid_type_operator_unary.snap @@ -5,7 +5,7 @@ expression: checked.errors [ CheckError { kind: InvalidTypeOperator { - id: Id(35), + id: Id(36), }, step: [], }, diff --git a/tests-integration/tests/snapshots/checking__quantify_multiple_scoped.snap b/tests-integration/tests/snapshots/checking__quantify_multiple_scoped.snap index ad8e64db..eb7418f9 100644 --- a/tests-integration/tests/snapshots/checking__quantify_multiple_scoped.snap +++ b/tests-integration/tests/snapshots/checking__quantify_multiple_scoped.snap @@ -2,4 +2,6 @@ source: tests-integration/tests/checking.rs expression: snapshot --- -forall (t0 :: Type) (t1 :: t0) (t2 :: t1) (t3 :: Type) (t4 :: t3) (t5 :: t4). t2 -> t5 +forall (t0 :: Type) (t1 :: (t0 :: Type)) (t2 :: (t1 :: ?0[:0])) (t3 :: Type) (t4 :: (t3 :: Type)) + (t5 :: (t4 :: ?3[:0])). + (t2 :: ?1[:0]) -> (t5 :: ?4[:0]) diff --git a/tests-integration/tests/snapshots/checking__quantify_ordering.snap b/tests-integration/tests/snapshots/checking__quantify_ordering.snap index 8e2c7f3a..e10d0a6b 100644 --- a/tests-integration/tests/snapshots/checking__quantify_ordering.snap +++ b/tests-integration/tests/snapshots/checking__quantify_ordering.snap @@ -2,4 +2,4 @@ source: tests-integration/tests/checking.rs expression: snapshot --- -forall (t0 :: Type) (t1 :: Type). t1 -> t0 +forall (t0 :: Type) (t1 :: Type). (t1 :: Type) -> (t0 :: Type) diff --git a/tests-integration/tests/snapshots/checking__quantify_polykind.snap b/tests-integration/tests/snapshots/checking__quantify_polykind.snap index c6c0781b..1cf0f21c 100644 --- a/tests-integration/tests/snapshots/checking__quantify_polykind.snap +++ b/tests-integration/tests/snapshots/checking__quantify_polykind.snap @@ -2,4 +2,4 @@ source: tests-integration/tests/checking.rs expression: snapshot --- -forall (t0 :: Type) (t1 :: t0). t1 +forall (t0 :: Type) (t1 :: (t0 :: Type)). (t1 :: ?0[:0]) diff --git a/tests-integration/tests/snapshots/checking__quantify_scoped.snap b/tests-integration/tests/snapshots/checking__quantify_scoped.snap index 9f58fb45..402d795d 100644 --- a/tests-integration/tests/snapshots/checking__quantify_scoped.snap +++ b/tests-integration/tests/snapshots/checking__quantify_scoped.snap @@ -2,4 +2,4 @@ source: tests-integration/tests/checking.rs expression: snapshot --- -forall (t0 :: Type) (t1 :: t0) (t2 :: t1). t2 +forall (t0 :: Type) (t1 :: (t0 :: Type)) (t2 :: (t1 :: ?0[:0])). (t2 :: ?1[:0]) diff --git a/tests-integration/tests/snapshots/checking__quantify_simple.snap b/tests-integration/tests/snapshots/checking__quantify_simple.snap index d162b8f9..f4c5c909 100644 --- a/tests-integration/tests/snapshots/checking__quantify_simple.snap +++ b/tests-integration/tests/snapshots/checking__quantify_simple.snap @@ -2,4 +2,4 @@ source: tests-integration/tests/checking.rs expression: snapshot --- -forall (t0 :: Type) (t1 :: Type). t0 -> t1 +forall (t0 :: Type) (t1 :: Type). (t0 :: Type) -> (t1 :: Type) diff --git a/tests-integration/tests/snapshots/checking__solve_bound.snap b/tests-integration/tests/snapshots/checking__solve_bound.snap index 4269efde..8f4e11d6 100644 --- a/tests-integration/tests/snapshots/checking__solve_bound.snap +++ b/tests-integration/tests/snapshots/checking__solve_bound.snap @@ -2,4 +2,4 @@ source: tests-integration/tests/checking.rs expression: snapshot --- -&0 -> &1 :: Type +(&0 :: Int) -> (&1 :: String) :: Type