mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Merge remote-tracking branch 'origin/trunk' into builtins-list-take-last
This commit is contained in:
commit
94efbd0e95
16 changed files with 415 additions and 8 deletions
|
@ -1093,6 +1093,23 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
Box::new(list_type(flex(TVAR1))),
|
||||
);
|
||||
|
||||
// find : List elem, (elem -> Bool) -> Result elem [ NotFound ]*
|
||||
{
|
||||
let not_found = SolvedType::TagUnion(
|
||||
vec![(TagName::Global("NotFound".into()), vec![])],
|
||||
Box::new(SolvedType::Wildcard),
|
||||
);
|
||||
let (elem, cvar) = (TVAR1, TVAR2);
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_FIND,
|
||||
vec![
|
||||
list_type(flex(elem)),
|
||||
closure(vec![flex(elem)], cvar, Box::new(bool_type())),
|
||||
],
|
||||
Box::new(result_type(flex(elem), not_found)),
|
||||
)
|
||||
}
|
||||
|
||||
// Dict module
|
||||
|
||||
// len : Dict * * -> Nat
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue