mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
add List.range
This commit is contained in:
parent
4ce520fed6
commit
d718e21fd3
11 changed files with 253 additions and 2 deletions
|
|
@ -799,7 +799,7 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
)
|
||||
});
|
||||
|
||||
// keepOks : List before, (before -> Result * after) -> List after
|
||||
// keepErrs: List before, (before -> Result * after) -> List after
|
||||
add_type(Symbol::LIST_KEEP_ERRS, {
|
||||
let_tvars! { star, cvar, before, after};
|
||||
top_level_function(
|
||||
|
|
@ -815,6 +815,14 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
)
|
||||
});
|
||||
|
||||
// range : Int a, Int a -> List (Int a)
|
||||
add_type(Symbol::LIST_RANGE, {
|
||||
top_level_function(
|
||||
vec![int_type(flex(TVAR1)), int_type(flex(TVAR1))],
|
||||
Box::new(list_type(int_type(flex(TVAR1)))),
|
||||
)
|
||||
});
|
||||
|
||||
// map : List before, (before -> after) -> List after
|
||||
add_type(
|
||||
Symbol::LIST_MAP,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue