Add List.concat

This commit is contained in:
Richard Feldman 2020-04-05 22:42:24 -04:00
parent 41662af399
commit 7ad4fb0e68
2 changed files with 10 additions and 0 deletions

View file

@ -408,6 +408,15 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
), ),
); );
// concat : List elem, List elem -> List elem
add_type(
Symbol::LIST_CONCAT,
SolvedType::Func(
vec![list_type(flex(TVAR1)), list_type(flex(TVAR1))],
Box::new(list_type(flex(TVAR1))),
),
);
// map : List before, (before -> after) -> List after // map : List before, (before -> after) -> List after
add_type( add_type(
Symbol::LIST_MAP, Symbol::LIST_MAP,

View file

@ -640,6 +640,7 @@ define_builtins! {
9 LIST_FOLDL: "foldl" 9 LIST_FOLDL: "foldl"
10 LIST_FOLDR: "foldr" 10 LIST_FOLDR: "foldr"
11 LIST_GET_UNSAFE: "getUnsafe" // TODO remove once we can code gen Result 11 LIST_GET_UNSAFE: "getUnsafe" // TODO remove once we can code gen Result
12 LIST_CONCAT: "concat"
} }
7 RESULT: "Result" => { 7 RESULT: "Result" => {
0 RESULT_RESULT: "Result" imported // the Result.Result type alias 0 RESULT_RESULT: "Result" imported // the Result.Result type alias