1- @ deprecated ( "Use a fn literal instead, it is easier to understand" )
2- pub fn compose ( fun1 : fn ( a) -> b, fun2 : fn ( b) -> c) -> fn ( a) -> c {
3- fn ( a ) { fun2 ( fun1 ( a ) ) }
4- }
5-
6- @ deprecated ( "Use the anonymous function syntax instead" )
7- pub fn curry2 ( fun : fn ( a, b) -> value) {
8- fn ( a ) { fn ( b ) { fun ( a , b ) } }
9- }
10-
11- @ deprecated ( "Use the anonymous function syntax instead" )
12- pub fn curry3 ( fun : fn ( a, b, c) -> value) {
13- fn ( a ) { fn ( b ) { fn ( c ) { fun ( a , b , c ) } } }
14- }
15-
16- @ deprecated ( "Use the anonymous function syntax instead" )
17- pub fn curry4 ( fun : fn ( a, b, c, d) -> value) {
18- fn ( a ) { fn ( b ) { fn ( c ) { fn ( d ) { fun ( a , b , c , d ) } } } }
19- }
20-
21- @ deprecated ( "Use the anonymous function syntax instead" )
22- pub fn curry5 ( fun : fn ( a, b, c, d, e) -> value) {
23- fn ( a ) { fn ( b ) { fn ( c ) { fn ( d ) { fn ( e ) { fun ( a , b , c , d , e ) } } } } }
24- }
25-
26- @ deprecated ( "Use the anonymous function syntax instead" )
27- pub fn curry6 ( fun : fn ( a, b, c, d, e, f) -> value) {
28- fn ( a ) {
29- fn ( b ) { fn ( c ) { fn ( d ) { fn ( e ) { fn ( f ) { fun ( a , b , c , d , e , f ) } } } } }
30- }
31- }
32-
331/// Takes a function that takes two arguments and returns a new function that
342/// takes the same two arguments, but in reverse order.
353///
@@ -43,11 +11,6 @@ pub fn identity(x: a) -> a {
4311 x
4412}
4513
46- @ deprecated ( "Use a fn literal instead, it is easier to understand" )
47- pub fn constant ( value : a) -> fn ( b) -> a {
48- fn ( _ ) { value }
49- }
50-
5114/// Takes an argument and a single function,
5215/// calls that function with that argument
5316/// and returns that argument instead of the function return value.
@@ -57,18 +20,3 @@ pub fn tap(arg: a, effect: fn(a) -> b) -> a {
5720 effect ( arg )
5821 arg
5922}
60-
61- @ deprecated ( "Use a fn literal instead, it is easier to understand" )
62- pub fn apply1 ( fun : fn ( a) -> value, arg1 : a) -> value {
63- fun ( arg1 )
64- }
65-
66- @ deprecated ( "Use a fn literal instead, it is easier to understand" )
67- pub fn apply2 ( fun : fn ( a, b) -> value, arg1 : a, arg2 : b) -> value {
68- fun ( arg1 , arg2 )
69- }
70-
71- @ deprecated ( "Use a fn literal instead, it is easier to understand" )
72- pub fn apply3 ( fun : fn ( a, b, c) -> value, arg1 : a, arg2 : b, arg3 : c) -> value {
73- fun ( arg1 , arg2 , arg3 )
74- }
0 commit comments