1 -module(hope_fun_SUITE).
14 , t_compose_and_thread/1
18 -define(GROUP, hope_fun).
21 %% ============================================================================
22 %% Common Test callbacks
23 %% ============================================================================
34 , t_compose_and_thread
36 Properties = [parallel],
37 [ {?GROUP, Properties, Tests}
41 %% =============================================================================
43 %% =============================================================================
46 [] = proper:check_specs(hope_fun).
53 Single = fun (X) -> X end,
54 Double = fun (X, Y) -> {X, Y} end,
55 Triple = fun (X, Y, Z) -> {X, Y, Z} end,
57 F = hope_fun:curry(Single),
60 G1 = hope_fun:curry(Double),
64 H1 = hope_fun:curry(Triple),
69 t_compose_and_thread(_Cfg) ->
70 A2B = fun (a) -> b end,
71 B2C = fun (b) -> c end,
72 C2D = fun (c) -> d end,
74 d = (hope_fun:compose ( Fs ))(a),
75 d = (hope_fun:compose_right ( Fs ))(a),
76 d = (hope_fun:compose_left (lists:reverse(Fs) ))(a),
77 d = hope_fun:thread (lists:reverse(Fs), a).