Function | No Fun | Bad Fun |
---|---|---|
all/2 |
badfun |
badarity |
any/2 |
badfun |
badarity |
dropwhile/2 |
badfun |
badarity |
filter/2 |
function_clause |
function_clause |
filtermap/2 |
badfun |
badarity |
flatmap/2 |
badfun |
badarity |
foreach/2 |
badfun |
badarity |
map/2 |
badfun |
badarity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(w2lists). | |
-export([prod/1,mymax/1,test/0]). | |
%Moddified according Elbrujohalcon: | |
%Removed the "list is emty" function clause as we will let it crash. | |
%prod([]) -> | |
% "list is empty"; | |
prod([H|T]) -> | |
prod(T,H). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(lists2). | |
-export([join/2,concat/1,member/2,sort/1,sort/2,perms/1]). | |
-export([join_test/0,concat_test/0,member_test/0,sort_test/0,perms_test/0]). | |
%% Join %%% | |
join(L1, L2) when is_list(L1), is_list(L2) -> | |
join_internal(lists:reverse(L1), L2). | |
join_internal(L1, []) -> lists:reverse(L1); | |
join_internal(L1, [H|T]) -> |
Existing map specification syntax, as was introduced in 17.0, allows the following different syntaxes:
-
map()
or#{}
: the type of any map (of any size). -
#{a => integer(), b => list()}
A map that may only contain keys a
and b
. If it contains a key a
, then it must be mapped to an integer value. Analogously for b
.