mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
and yet another result wrapper
This commit is contained in:
parent
2e9477e011
commit
29a9564d36
1 changed files with 26 additions and 19 deletions
|
@ -615,11 +615,7 @@ enum Msg<'a> {
|
||||||
Many(Vec<Msg<'a>>),
|
Many(Vec<Msg<'a>>),
|
||||||
Header(ModuleHeader<'a>),
|
Header(ModuleHeader<'a>),
|
||||||
Parsed(ParsedModule<'a>),
|
Parsed(ParsedModule<'a>),
|
||||||
CanonicalizedAndConstrained {
|
CanonicalizedAndConstrained(CanAndCon),
|
||||||
constrained_module: ConstrainedModule,
|
|
||||||
canonicalization_problems: Vec<roc_problem::can::Problem>,
|
|
||||||
module_docs: Option<ModuleDocumentation>,
|
|
||||||
},
|
|
||||||
SolvedTypes {
|
SolvedTypes {
|
||||||
module_id: ModuleId,
|
module_id: ModuleId,
|
||||||
ident_ids: IdentIds,
|
ident_ids: IdentIds,
|
||||||
|
@ -674,6 +670,13 @@ enum Msg<'a> {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
struct CanAndCon {
|
||||||
|
constrained_module: ConstrainedModule,
|
||||||
|
canonicalization_problems: Vec<roc_problem::can::Problem>,
|
||||||
|
module_docs: Option<ModuleDocumentation>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum PlatformPath<'a> {
|
enum PlatformPath<'a> {
|
||||||
NotSpecified,
|
NotSpecified,
|
||||||
|
@ -2004,11 +2007,11 @@ fn update<'a>(
|
||||||
Ok(state)
|
Ok(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
CanonicalizedAndConstrained {
|
CanonicalizedAndConstrained(CanAndCon {
|
||||||
constrained_module,
|
constrained_module,
|
||||||
canonicalization_problems,
|
canonicalization_problems,
|
||||||
module_docs,
|
module_docs,
|
||||||
} => {
|
}) => {
|
||||||
let module_id = constrained_module.module.module_id;
|
let module_id = constrained_module.module.module_id;
|
||||||
log!("generated constraints for {:?}", module_id);
|
log!("generated constraints for {:?}", module_id);
|
||||||
state
|
state
|
||||||
|
@ -3854,7 +3857,7 @@ fn canonicalize_and_constrain<'a>(
|
||||||
aliases: MutMap<Symbol, Alias>,
|
aliases: MutMap<Symbol, Alias>,
|
||||||
parsed: ParsedModule<'a>,
|
parsed: ParsedModule<'a>,
|
||||||
skip_constraint_gen: bool,
|
skip_constraint_gen: bool,
|
||||||
) -> Result<Msg<'a>, LoadingProblem<'a>> {
|
) -> CanAndCon {
|
||||||
let canonicalize_start = SystemTime::now();
|
let canonicalize_start = SystemTime::now();
|
||||||
|
|
||||||
let ParsedModule {
|
let ParsedModule {
|
||||||
|
@ -3987,11 +3990,11 @@ fn canonicalize_and_constrain<'a>(
|
||||||
module_timing,
|
module_timing,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(Msg::CanonicalizedAndConstrained {
|
CanAndCon {
|
||||||
constrained_module,
|
constrained_module,
|
||||||
canonicalization_problems: module_output.problems,
|
canonicalization_problems: module_output.problems,
|
||||||
module_docs,
|
module_docs,
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse<'a>(arena: &'a Bump, header: ModuleHeader<'a>) -> Result<Msg<'a>, LoadingProblem<'a>> {
|
fn parse<'a>(arena: &'a Bump, header: ModuleHeader<'a>) -> Result<Msg<'a>, LoadingProblem<'a>> {
|
||||||
|
@ -4460,7 +4463,8 @@ fn run_task<'a>(
|
||||||
exposed_symbols,
|
exposed_symbols,
|
||||||
aliases,
|
aliases,
|
||||||
skip_constraint_gen,
|
skip_constraint_gen,
|
||||||
} => canonicalize_and_constrain(
|
} => {
|
||||||
|
let can_and_con = canonicalize_and_constrain(
|
||||||
arena,
|
arena,
|
||||||
&module_ids,
|
&module_ids,
|
||||||
dep_idents,
|
dep_idents,
|
||||||
|
@ -4468,7 +4472,10 @@ fn run_task<'a>(
|
||||||
aliases,
|
aliases,
|
||||||
parsed,
|
parsed,
|
||||||
skip_constraint_gen,
|
skip_constraint_gen,
|
||||||
),
|
);
|
||||||
|
|
||||||
|
Ok(Msg::CanonicalizedAndConstrained(can_and_con))
|
||||||
|
}
|
||||||
Solve {
|
Solve {
|
||||||
module,
|
module,
|
||||||
module_timing,
|
module_timing,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue