From 6a34b9355c563d042bde23e76cb425eb1f1b4e1c Mon Sep 17 00:00:00 2001 From: Chad Stearns Date: Mon, 24 Aug 2020 03:36:08 -0400 Subject: [PATCH] reverted to original unique for List.map --- compiler/builtins/src/unique.rs | 37 +++++---------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/compiler/builtins/src/unique.rs b/compiler/builtins/src/unique.rs index 3fcdfaf05f..f66f5094d8 100644 --- a/compiler/builtins/src/unique.rs +++ b/compiler/builtins/src/unique.rs @@ -772,42 +772,15 @@ pub fn types() -> MutMap { // , Attr Shared (a -> b) // -> Attr * (List b) add_type(Symbol::LIST_MAP, { - let_tvars! { star1, star2, star3, a, b }; + let_tvars! { a, b, 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![ - flex(star2), - SolvedType::Func(vec![flex(a)], Box::new(flex(b))), - ], - ), + list_type(star1, a), + shared(SolvedType::Func(vec![flex(a)], Box::new(flex(b)))), ], - SolvedType::Apply( - Symbol::ATTR_ATTR, - vec![ - flex(star3), - SolvedType::Apply(Symbol::LIST_LIST, vec![flex(b)]), - ], - ), + list_type(star2, 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))