mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
LIST_REVERSE works, so long as the list is made up of ints equal to 1
This commit is contained in:
parent
d8a8741aed
commit
7bd7e697b0
4 changed files with 41 additions and 6 deletions
|
@ -630,6 +630,28 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
)
|
||||
});
|
||||
|
||||
// reverse : Attr * (List (Attr * a)) -> Attr * (List (Attr * a))
|
||||
add_type(Symbol::LIST_REVERSE, {
|
||||
let_tvars! { a, star1, star2 };
|
||||
|
||||
unique_function(
|
||||
vec![SolvedType::Apply(
|
||||
Symbol::ATTR_ATTR,
|
||||
vec![
|
||||
flex(star1),
|
||||
SolvedType::Apply(Symbol::LIST_LIST, vec![flex(a)]),
|
||||
],
|
||||
)],
|
||||
SolvedType::Apply(
|
||||
Symbol::ATTR_ATTR,
|
||||
vec![
|
||||
boolean(star2),
|
||||
SolvedType::Apply(Symbol::LIST_LIST, vec![flex(a)]),
|
||||
],
|
||||
),
|
||||
)
|
||||
});
|
||||
|
||||
// push : Attr * (List a)
|
||||
// , a
|
||||
// -> Attr * (List a)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue