on master help sign in
Remove the `find` function.
b4665fdevancz
core-elm/Dict.elm+3−1
@@ -1,6 +1,6 @@
1
1
2module Dict (empty,singleton,insert
2module Dict (empty,singleton,insert
3− ,lookup,find,findWithDefault
3+ ,lookup,findWithDefault
4 ,remove,member
4 ,remove,member
5 ,foldl,foldr,map
5 ,foldl,foldr,map
6 ,union,intersect,diff
6 ,union,intersect,diff
@@ -133,6 +133,7 @@ findWithDefault base k t =
133 ; GT -> findWithDefault base k r }
133 ; GT -> findWithDefault base k r }
134 }
134 }
135
135
136+{--
136find k t =
137find k t =
137 case t of
138 case t of
138 { RBEmpty -> raise "Key was not found in dictionary!"
139 { RBEmpty -> raise "Key was not found in dictionary!"
@@ -142,6 +143,7 @@ find k t =
142 ; EQ -> v
143 ; EQ -> v
143 ; GT -> find k r }
144 ; GT -> find k r }
144 }
145 }
146+--}
145
147
146-- Does t contain k?
148-- Does t contain k?
147member k t = isJust $ lookup k t
149member k t = isJust $ lookup k t
core-js/Dict.js+1−21
@@ -76,26 +76,6 @@ Elm.Dict=function(){
76 throw "Non-exhaustive pattern match in case";}();
76 throw "Non-exhaustive pattern match in case";}();
77 }
77 }
78 throw "Non-exhaustive pattern match in case";}();};};};
78 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";}();};};
99 function member_10(k_66){
79 function member_10(k_66){
100 return function(t_67){
80 return function(t_67){
101 return isJust(lookup_7(k_66)(t_67));};};
81 return isJust(lookup_7(k_66)(t_67));};};
@@ -497,7 +477,7 @@ Elm.Dict=function(){
497 return ["Cons",["Tuple2",k_232,v_233],acc_234];};};})(["Nil"])(t_231);};
477 return ["Cons",["Tuple2",k_232,v_233],acc_234];};};})(["Nil"])(t_231);};
498 function fromList_42(assocs_235){
478 function fromList_42(assocs_235){
499 return List.foldl(uncurry(insert_20))(empty_4)(assocs_235);};
479 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};}();
501Elm.main=function(){
481Elm.main=function(){
502 return Elm.Dict.main;};
482 return Elm.Dict.main;};
503} 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;};}
483} 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;};}