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(el). | |
-export([warn/2, warn_case/1]). | |
-export([clean/2, clean_case/1]). | |
warn(X, Y) -> | |
{just, X and Y}; | |
warn(6, 6) -> | |
{six, 6}. |
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(pi). | |
-format #{paper => 80}. | |
-export([check/0]). | |
check() -> | |
Pid = spawn(fun wait/0), | |
erlang:yield(), |
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(pi). | |
-export([check/0]). | |
check() -> | |
Pid = spawn(fun wait/0), | |
erlang:yield(), | |
PI1 = erlang:process_info(Pid), | |
PI2 = erlang:process_info(Pid), | |
Pid ! stop, |
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
%% @doc Frequency server that "transmits" errors from server to client | |
-module frequency. | |
-export [test/0]. | |
-export [start/0, allocate/0, deallocate/1]. | |
-export [init/0]. | |
test() -> | |
%% Ensure the server is killed... This is ugly | |
catch exit(whereis(frequency), kill), |
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 busy. | |
-export [loop/0]. | |
-export [test/0]. | |
test() -> | |
start_server(), | |
{error, server_down} = call(server, die), % Your code will catch this | |
start_server(), | |
pong = call(server, ping_and_sleep), |
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
%% @doc Benchmark functions over lists. | |
%% Use it like: c(test), test:bench({test, rec}, 250, 5000, 2000). | |
-module test. | |
-export [ | |
bench/4, | |
bench_tc/2, | |
rec/1, | |
lrec/1 | |
]. |
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(palin). | |
-export([test/0]). | |
-export([server/0]). | |
-export([start/0, check/2, stop/1]). | |
test() -> | |
Checks = [{"Abba", true}, | |
{"baba", false}, | |
{"Yo hago yoga hoy", true}, |
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
get_status_map(StormidMap) -> | |
get_status_map(?SEVERITY, StormidMap, #{}). | |
get_status_map([], _, Acc) -> Acc; | |
get_status_map([Status|Statuses], StormidMap, Acc) -> | |
NewAcc = Acc#{Status => get_storms(Status, maps:values(StormidMap))}, | |
get_status_map(Statuses, StormidMap, NewAcc). | |
get_storms(Status, Storms) -> |
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 joe. | |
-export [test/0, perms/1]. | |
test() -> | |
[[]] = joe:perms(""), | |
["a"] = joe:perms("a"), | |
["ab", "ba"] = joe:perms("ab"), | |
["ba", "ab"] = joe:perms("ba"), | |
["123","132","213","231","312","321"] = joe:perms("123"), |
NewerOlder