on master help sign in
Remove the `find` function.
commitb4665fd2fbc2ecdcf9f7cb1026c6af5607639e4e authorevancz <info@elm-lang.org> dateSun 21 Oct 2012, 04:52 (14 years ago) parent56b5e53
2 files changed+4−22
core-elm/Dict.elm+3−1 core-js/Dict.js+1−21
core-elm/Dict.elm+3−1
@@ -1,6 +1,6 @@
11
22module Dict (empty,singleton,insert
3− ,lookup,find,findWithDefault
3+ ,lookup,findWithDefault
44 ,remove,member
55 ,foldl,foldr,map
66 ,union,intersect,diff
@@ -133,6 +133,7 @@ findWithDefault base k t =
133133 ; GT -> findWithDefault base k r }
134134 }
135135
136+{--
136137find k t =
137138 case t of
138139 { RBEmpty -> raise "Key was not found in dictionary!"
@@ -142,6 +143,7 @@ find k t =
142143 ; EQ -> v
143144 ; GT -> find k r }
144145 }
146+--}
145147
146148-- Does t contain k?
147149member k t = isJust $ lookup k t
core-js/Dict.js+1−21
@@ -76,26 +76,6 @@ Elm.Dict=function(){
7676 throw "Non-exhaustive pattern match in case";}();
7777 }
7878 throw "Non-exhaustive pattern match in case";}();};};};
79− function find_9(k_60){
80− return function(t_61){
81− return function(){
82− switch(t_61[0]){
83− case "RBEmpty":
84− return raise_5(Value.str("Key was not found in dictionary!"));
85− case "RBNode":
86− return function(){
87− var case6=compare(k_60)(t_61[2]);
88− switch(case6[0]){
89− case "EQ":
90− return t_61[3];
91− case "GT":
92− return find_9(k_60)(t_61[5]);
93− case "LT":
94− return find_9(k_60)(t_61[4]);
95− }
96− throw "Non-exhaustive pattern match in case";}();
97− }
98− throw "Non-exhaustive pattern match in case";}();};};
9979 function member_10(k_66){
10080 return function(t_67){
10181 return isJust(lookup_7(k_66)(t_67));};};
@@ -497,7 +477,7 @@ Elm.Dict=function(){
497477 return ["Cons",["Tuple2",k_232,v_233],acc_234];};};})(["Nil"])(t_231);};
498478 function fromList_42(assocs_235){
499479 return List.foldl(uncurry(insert_20))(empty_4)(assocs_235);};
500− return {empty:empty_4,lookup:lookup_7,findWithDefault:findWithDefault_8,find:find_9,member:member_10,insert:insert_20,singleton:singleton_21,remove:remove_32,map:map_33,foldl:foldl_34,foldr:foldr_35,union:union_36,intersect:intersect_37,diff:diff_38,keys:keys_39,values:values_40,toList:toList_41,fromList:fromList_42};}();
480+ return {empty:empty_4,lookup:lookup_7,findWithDefault:findWithDefault_8,member:member_10,insert:insert_20,singleton:singleton_21,remove:remove_32,map:map_33,foldl:foldl_34,foldr:foldr_35,union:union_36,intersect:intersect_37,diff:diff_38,keys:keys_39,values:values_40,toList:toList_41,fromList:fromList_42};}();
501481Elm.main=function(){
502482 return Elm.Dict.main;};
503483} catch (e) {Elm.main=function() {var msg = ('<br/><h2>Your browser may not be supported. Are you using a modern browser?</h2>' + '<br/><span style="color:grey">Runtime Error in Dict module:<br/>' + e + '</span>');document.body.innerHTML = Text.monospace(msg);throw e;};}