Add builtin List.intersperse

This commit is contained in:
satotake 2021-11-17 15:18:45 +00:00 committed by GitHub
parent 8f25106b2c
commit 16fb04b4fa
5 changed files with 120 additions and 0 deletions

View file

@ -1140,6 +1140,13 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
)
}
// intersperse : List elem, elem -> List elem
add_top_level_function_type!(
Symbol::LIST_INTERSPERSE,
vec![list_type(flex(TVAR1)), flex(TVAR1)],
Box::new(list_type(flex(TVAR1))),
);
// Dict module
// len : Dict * * -> Nat