Parameterize program solving on a FunctionKind

This new flag determines whether we should introduce a new kind to
represent lambda sets, or whether lambdas should be erased. The latter
is not yet implemented.
This commit is contained in:
Ayaz Hafiz 2023-06-19 21:43:42 -05:00
parent 60c98ea5d5
commit 44c4797d9a
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
29 changed files with 126 additions and 13 deletions

View file

@ -32,6 +32,7 @@ roc_load = { path = "../compiler/load" }
roc_parse = { path = "../compiler/parse" }
roc_repl_eval = { path = "../repl_eval" }
roc_reporting = { path = "../reporting" }
roc_solve = { path = "../compiler/solve" }
roc_target = { path = "../compiler/roc_target" }
roc_types = { path = "../compiler/types" }

View file

@ -180,6 +180,7 @@ pub async fn entrypoint_from_js(src: String) -> Result<String, String> {
// Compile the app
let target_info = TargetInfo::default_wasm32();
let function_kind = roc_solve::FunctionKind::LambdaSet;
// TODO use this to filter out problems and warnings in wrapped defs.
// See the variable by the same name in the CLI REPL for how to do this!
let mono = match compile_to_mono(
@ -187,6 +188,7 @@ pub async fn entrypoint_from_js(src: String) -> Result<String, String> {
std::iter::empty(),
&src,
target_info,
function_kind,
DEFAULT_PALETTE_HTML,
) {
(Some(m), problems) if problems.is_empty() => m, // TODO render problems and continue if possible