reverted to original unique for List.map

This commit is contained in:
Chad Stearns 2020-08-24 03:36:08 -04:00
parent ddc15fd2ea
commit 6a34b9355c

View file

@ -772,42 +772,15 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
// , Attr Shared (a -> b) // , Attr Shared (a -> b)
// -> Attr * (List b) // -> Attr * (List b)
add_type(Symbol::LIST_MAP, { add_type(Symbol::LIST_MAP, {
let_tvars! { star1, star2, star3, a, b }; let_tvars! { a, b, star1, star2 };
unique_function( unique_function(
vec![ vec![
SolvedType::Apply( list_type(star1, a),
Symbol::ATTR_ATTR, shared(SolvedType::Func(vec![flex(a)], Box::new(flex(b)))),
vec![
flex(star1),
SolvedType::Apply(Symbol::LIST_LIST, vec![flex(a)]),
],
),
SolvedType::Apply(
Symbol::ATTR_ATTR,
vec![
flex(star2),
SolvedType::Func(vec![flex(a)], Box::new(flex(b))),
],
),
], ],
SolvedType::Apply( list_type(star2, b),
Symbol::ATTR_ATTR,
vec![
flex(star3),
SolvedType::Apply(Symbol::LIST_LIST, vec![flex(b)]),
],
),
) )
// let_tvars! { a, b, star1, star2 };
//
// unique_function(
// vec![
// list_type(star1, a),
// shared(SolvedType::Func(vec![flex(a)], Box::new(flex(b)))),
// ],
// list_type(star2, b),
// )
}); });
// foldr : Attr (* | u) (List (Attr u a)) // foldr : Attr (* | u) (List (Attr u a))