mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
add Result.after
This commit is contained in:
parent
d7904b1d41
commit
d8bc44fd47
3 changed files with 111 additions and 0 deletions
|
@ -1137,6 +1137,22 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
),
|
||||
);
|
||||
|
||||
// after : Result a err, (a -> Result b err) -> Result b err
|
||||
add_type(
|
||||
Symbol::RESULT_AFTER,
|
||||
top_level_function(
|
||||
vec![
|
||||
result_type(flex(TVAR1), flex(TVAR3)),
|
||||
closure(
|
||||
vec![flex(TVAR1)],
|
||||
TVAR4,
|
||||
Box::new(result_type(flex(TVAR2), flex(TVAR3))),
|
||||
),
|
||||
],
|
||||
Box::new(result_type(flex(TVAR2), flex(TVAR3))),
|
||||
),
|
||||
);
|
||||
|
||||
// withDefault : Result a x, a -> a
|
||||
add_type(
|
||||
Symbol::RESULT_WITH_DEFAULT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue