aboutsummaryrefslogtreecommitdiff
path: root/gen/map.erl
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-03-10 20:07:37 +0000
committerLouis Pilfold <louis@lpil.uk>2019-03-10 20:07:37 +0000
commit2a7d9061e4ec9c763053b078db2d98400bd08dd5 (patch)
treea6f36c30dc08db6a85cd1dad4b99031380e81832 /gen/map.erl
parentd74af16e6a527f46730c3d35554ef55677c9caf4 (diff)
downloadgleam_stdlib-2a7d9061e4ec9c763053b078db2d98400bd08dd5.tar.gz
gleam_stdlib-2a7d9061e4ec9c763053b078db2d98400bd08dd5.zip
Surround Fn's in parens if called directly
Closes https://github.com/lpil/gleam/issues/88
Diffstat (limited to 'gen/map.erl')
-rw-r--r--gen/map.erl28
1 files changed, 14 insertions, 14 deletions
diff --git a/gen/map.erl b/gen/map.erl
index b6327cd..db29fd0 100644
--- a/gen/map.erl
+++ b/gen/map.erl
@@ -19,8 +19,8 @@ from_list(A) ->
from_list_test() ->
Proplist = [{4, 0}, {1, 0}],
Map = from_list(Proplist),
- _ = fun(Capture1) -> expect:equal(Capture1, 2) end(size(Map)),
- fun(Capture1) -> expect:equal(Capture1, Proplist) end(to_list(Map)).
+ _ = (fun(Capture1) -> expect:equal(Capture1, 2) end)(size(Map)),
+ (fun(Capture1) -> expect:equal(Capture1, Proplist) end)(to_list(Map)).
-endif.
fetch(A, B) ->
@@ -30,12 +30,12 @@ fetch(A, B) ->
fetch_test() ->
Proplist = [{4, 0}, {1, 1}],
Map = from_list(Proplist),
- _ = fun(Capture1) ->
+ _ = (fun(Capture1) ->
expect:equal(Capture1, {ok, 0})
- end(fun(Capture1) -> fetch(Capture1, 4) end(Map)),
- fun(Capture1) ->
+ end)((fun(Capture1) -> fetch(Capture1, 4) end)(Map)),
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, 1})
- end(fun(Capture1) -> fetch(Capture1, 1) end(Map)).
+ end)((fun(Capture1) -> fetch(Capture1, 1) end)(Map)).
-endif.
erl_map_values(A, B) ->
@@ -46,11 +46,11 @@ map_values(Map, Fun) ->
-ifdef(TEST).
map_values_test() ->
- fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, from_list([{1, 0}, {2, 3}, {3, 5}]))
- end(fun(Capture1) ->
- map_values(Capture1, fun(K, V) -> K + V end)
- end(from_list([{1, 0}, {2, 1}, {3, 2}]))).
+ end)((fun(Capture1) ->
+ map_values(Capture1, fun(K, V) -> K + V end)
+ end)(from_list([{1, 0}, {2, 1}, {3, 2}]))).
-endif.
keys(A) ->
@@ -58,9 +58,9 @@ keys(A) ->
-ifdef(TEST).
keys_test() ->
- fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, [<<"a">>, <<"b">>, <<"c">>])
- end(keys(from_list([{<<"a">>, 0}, {<<"b">>, 1}, {<<"c">>, 2}]))).
+ end)(keys(from_list([{<<"a">>, 0}, {<<"b">>, 1}, {<<"c">>, 2}]))).
-endif.
values(A) ->
@@ -68,9 +68,9 @@ values(A) ->
-ifdef(TEST).
values_test() ->
- fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, [0, 1, 2])
- end(values(from_list([{<<"a">>, 0}, {<<"b">>, 1}, {<<"c">>, 2}]))).
+ end)(values(from_list([{<<"a">>, 0}, {<<"b">>, 1}, {<<"c">>, 2}]))).
-endif.
erl_filter(A, B) ->