unique and std work, check if delimiter is longer than str

This commit is contained in:
Chad Stearns 2020-09-27 14:27:56 -04:00
parent 5fe6eefa97
commit 43960cf1c6
6 changed files with 108 additions and 3 deletions

View file

@ -1105,6 +1105,24 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
// Str module
// Str.split :
// Attr * Str,
// Attr * Str
// -> Attr * (List (Attr * Str))
add_type(Symbol::STR_SPLIT, {
let_tvars! { star1, star2, star3, star4 };
unique_function(
vec![str_type(star1), str_type(star2)],
SolvedType::Apply(
Symbol::ATTR_ATTR,
vec![
flex(star3),
SolvedType::Apply(Symbol::LIST_LIST, vec![str_type(star4)]),
],
),
)
});
// isEmpty : Attr * Str -> Attr * Bool
add_type(Symbol::STR_IS_EMPTY, {
let_tvars! { star1, star2 };