Fix hardcoded List.isEmpty type

This commit is contained in:
Richard Feldman 2020-04-25 07:00:24 -04:00
parent 7b03091414
commit bac940e116

View File

@ -371,18 +371,6 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
// List module
// isEmpty : List * -> Bool
add_type(
Symbol::LIST_IS_EMPTY,
SolvedType::Func(
vec![SolvedType::Apply(
Symbol::LIST_LIST,
vec![SolvedType::Wildcard],
)],
Box::new(bool_type()),
),
);
// get : List elem, Int -> Result elem [ IndexOutOfBounds ]*
let index_out_of_bounds = SolvedType::TagUnion(
vec![(TagName::Global("IndexOutOfBounds".into()), vec![])],
@ -463,6 +451,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
SolvedType::Func(vec![list_type(flex(TVAR1))], Box::new(int_type())),
);
// isEmpty : List * -> Bool
add_type(
Symbol::LIST_IS_EMPTY,
SolvedType::Func(vec![list_type(flex(TVAR1))], Box::new(bool_type())),
);
// Map module
// empty : Map k v