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

@ -11,6 +11,7 @@ use roc_load::{LoadingProblem, MonomorphizedModule};
use roc_parse::ast::Expr;
use roc_region::all::LineInfo;
use roc_reporting::report::{can_problem, type_problem, RocDocAllocator};
use roc_solve::FunctionKind;
use roc_target::TargetInfo;
#[derive(Debug)]
@ -49,6 +50,7 @@ pub fn compile_to_mono<'a, 'i, I: Iterator<Item = &'i str>>(
defs: I,
expr: &str,
target_info: TargetInfo,
function_kind: FunctionKind,
palette: Palette,
) -> (Option<MonomorphizedModule<'a>>, Problems) {
let filename = PathBuf::from("");
@ -62,6 +64,7 @@ pub fn compile_to_mono<'a, 'i, I: Iterator<Item = &'i str>>(
RocCacheDir::Persistent(cache::roc_cache_dir().as_path()),
LoadConfig {
target_info,
function_kind,
render: roc_reporting::report::RenderTarget::ColorTerminal,
palette,
threading: Threading::Single,