home
/
code
/
hope.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement hope_list:map_slow/2
[hope.git]
/
src
/
hope_list.erl
diff --git
a/src/hope_list.erl
b/src/hope_list.erl
index
b93ad2d
..
aba9944
100644
(file)
--- a/
src/hope_list.erl
+++ b/
src/hope_list.erl
@@
-7,6
+7,7
@@
-export(
[ unique_preserve_order/1
, map_rev/2
-export(
[ unique_preserve_order/1
, map_rev/2
+ , map_slow/2
]).
]).
@@
-14,6
+15,14
@@
[A].
[A].
+%% @doc lists:reverse(map_rev(L, F))
+%% @end
+-spec map_slow([A], fun((A) -> (B))) ->
+ [B].
+map_slow(Xs, F) ->
+ lists:reverse(map_rev(Xs, F)).
+
+
%% @doc O(N), tail-recursive equivalent to lists:rev(lists:map(F, L))
%% @end
-spec map_rev([A], fun((A) -> (B))) ->
%% @doc O(N), tail-recursive equivalent to lists:rev(lists:map(F, L))
%% @end
-spec map_rev([A], fun((A) -> (B))) ->
This page took
0.023397 seconds
and
4
git commands to generate.