Current section
Files
Jump to
Current section
Files
src/zipnotic.erl
-module(zipnotic).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([zip_2/2, unzip_2/1, unzip_longest_2/1, strict_zip_2/2, zip_3/3, unzip_3/1, unzip_longest_3/1, strict_zip_3/3, zip_4/4, unzip_4/1, unzip_longest_4/1, strict_zip_4/4, pop/1, zip_longest_2/2, zip_longest_3/3, zip_longest_4/4]).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 56).
-spec zip_2(list(FVI), list(FVK)) -> list({FVI, FVK}).
zip_2(List, Other) ->
_pipe = List,
gleam@list:zip(_pipe, Other).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 66).
-spec unzip_2(list({FVN, FVO})) -> {list(FVN), list(FVO)}.
unzip_2(Input) ->
_pipe = Input,
gleam@list:unzip(_pipe).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 38).
-spec unzip_longest_2(
list({gleam@option:option(FVB), gleam@option:option(FVD)})
) -> {list(FVB), list(FVD)}.
unzip_longest_2(Input) ->
{First, Second} = unzip_2(Input),
{begin
_pipe = First,
gleam@list:filter_map(
_pipe,
fun(_capture) -> gleam@option:to_result(_capture, nil) end
)
end,
begin
_pipe@1 = Second,
gleam@list:filter_map(
_pipe@1,
fun(_capture@1) -> gleam@option:to_result(_capture@1, nil) end
)
end}.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 80).
-spec strict_zip_2(list(FVS), list(FVU)) -> {ok, list({FVS, FVU})} |
{error, nil}.
strict_zip_2(List, Other) ->
_pipe = List,
gleam@list:strict_zip(_pipe, Other).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 148).
-spec do_zip_3(list(FXO), list(FXQ), list(FXS), list({FXO, FXQ, FXS})) -> list({FXO,
FXQ,
FXS}).
do_zip_3(List, Other_1, Other_2, Acc) ->
case {List, Other_1, Other_2} of
{[A | A_rest], [B | B_rest], [C | C_rest]} ->
do_zip_3(A_rest, B_rest, C_rest, [{A, B, C} | Acc]);
{_, _, _} ->
_pipe = Acc,
lists:reverse(_pipe)
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 140).
-spec zip_3(list(FXH), list(FXJ), list(FXL)) -> list({FXH, FXJ, FXL}).
zip_3(List, Other_1, Other_2) ->
do_zip_3(List, Other_1, Other_2, []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 171).
-spec do_unzip_3(list({FYD, FYE, FYF}), list(FYD), list(FYE), list(FYF)) -> {list(FYD),
list(FYE),
list(FYF)}.
do_unzip_3(Input, Acc_1, Acc_2, Acc_3) ->
case Input of
[] ->
{begin
_pipe = Acc_1,
lists:reverse(_pipe)
end,
begin
_pipe@1 = Acc_2,
lists:reverse(_pipe@1)
end,
begin
_pipe@2 = Acc_3,
lists:reverse(_pipe@2)
end};
[{A, B, C} | Rest] ->
do_unzip_3(Rest, [A | Acc_1], [B | Acc_2], [C | Acc_3])
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 167).
-spec unzip_3(list({FXW, FXX, FXY})) -> {list(FXW), list(FXX), list(FXY)}.
unzip_3(Input) ->
_pipe = Input,
do_unzip_3(_pipe, [], [], []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 121).
-spec unzip_longest_3(
list({gleam@option:option(FWX),
gleam@option:option(FWZ),
gleam@option:option(FXB)})
) -> {list(FWX), list(FWZ), list(FXB)}.
unzip_longest_3(Input) ->
{First, Second, Third} = unzip_3(Input),
{begin
_pipe = First,
gleam@list:filter_map(
_pipe,
fun(_capture) -> gleam@option:to_result(_capture, nil) end
)
end,
begin
_pipe@1 = Second,
gleam@list:filter_map(
_pipe@1,
fun(_capture@1) -> gleam@option:to_result(_capture@1, nil) end
)
end,
begin
_pipe@2 = Third,
gleam@list:filter_map(
_pipe@2,
fun(_capture@2) -> gleam@option:to_result(_capture@2, nil) end
)
end}.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 202).
-spec do_strict_zip_3(list(FYW), list(FYY), list(FZA), list({FYW, FYY, FZA})) -> {ok,
list({FYW, FYY, FZA})} |
{error, nil}.
do_strict_zip_3(List, Other_1, Other_2, Acc) ->
case {List, Other_1, Other_2} of
{[], [], []} ->
{ok,
begin
_pipe = Acc,
lists:reverse(_pipe)
end};
{[], _, _} ->
{error, nil};
{_, [], _} ->
{error, nil};
{_, _, []} ->
{error, nil};
{[A | A_rest], [B | B_rest], [C | C_rest]} ->
do_strict_zip_3(A_rest, B_rest, C_rest, [{A, B, C} | Acc])
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 194).
-spec strict_zip_3(list(FYN), list(FYP), list(FYR)) -> {ok,
list({FYN, FYP, FYR})} |
{error, nil}.
strict_zip_3(List, Other_1, Other_2) ->
do_strict_zip_3(List, Other_1, Other_2, []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 283).
-spec do_zip_4(
list(GBH),
list(GBJ),
list(GBL),
list(GBN),
list({GBH, GBJ, GBL, GBN})
) -> list({GBH, GBJ, GBL, GBN}).
do_zip_4(List, Other_1, Other_2, Other_3, Acc) ->
case {List, Other_1, Other_2, Other_3} of
{[A | A_rest], [B | B_rest], [C | C_rest], [D | D_rest]} ->
do_zip_4(A_rest, B_rest, C_rest, D_rest, [{A, B, C, D} | Acc]);
{_, _, _, _} ->
_pipe = Acc,
lists:reverse(_pipe)
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 274).
-spec zip_4(list(GAY), list(GBA), list(GBC), list(GBE)) -> list({GAY,
GBA,
GBC,
GBE}).
zip_4(List, Other_1, Other_2, Other_3) ->
do_zip_4(List, Other_1, Other_2, Other_3, []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 309).
-spec do_unzip_4(
list({GCA, GCB, GCC, GCD}),
list(GCA),
list(GCB),
list(GCC),
list(GCD)
) -> {list(GCA), list(GCB), list(GCC), list(GCD)}.
do_unzip_4(Input, Acc_1, Acc_2, Acc_3, Acc_4) ->
case Input of
[] ->
{begin
_pipe = Acc_1,
lists:reverse(_pipe)
end,
begin
_pipe@1 = Acc_2,
lists:reverse(_pipe@1)
end,
begin
_pipe@2 = Acc_3,
lists:reverse(_pipe@2)
end,
begin
_pipe@3 = Acc_4,
lists:reverse(_pipe@3)
end};
[{A, B, C, D} | Rest] ->
do_unzip_4(Rest, [A | Acc_1], [B | Acc_2], [C | Acc_3], [D | Acc_4])
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 303).
-spec unzip_4(list({GBR, GBS, GBT, GBU})) -> {list(GBR),
list(GBS),
list(GBT),
list(GBU)}.
unzip_4(Input) ->
_pipe = Input,
do_unzip_4(_pipe, [], [], [], []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 254).
-spec unzip_longest_4(
list({gleam@option:option(GAL),
gleam@option:option(GAN),
gleam@option:option(GAP),
gleam@option:option(GAR)})
) -> {list(GAL), list(GAN), list(GAP), list(GAR)}.
unzip_longest_4(Input) ->
{First, Second, Third, Fourth} = unzip_4(Input),
{begin
_pipe = First,
gleam@list:filter_map(
_pipe,
fun(_capture) -> gleam@option:to_result(_capture, nil) end
)
end,
begin
_pipe@1 = Second,
gleam@list:filter_map(
_pipe@1,
fun(_capture@1) -> gleam@option:to_result(_capture@1, nil) end
)
end,
begin
_pipe@2 = Third,
gleam@list:filter_map(
_pipe@2,
fun(_capture@2) -> gleam@option:to_result(_capture@2, nil) end
)
end,
begin
_pipe@3 = Fourth,
gleam@list:filter_map(
_pipe@3,
fun(_capture@3) -> gleam@option:to_result(_capture@3, nil) end
)
end}.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 347).
-spec do_strict_zip_4(
list(GCY),
list(GDA),
list(GDC),
list(GDE),
list({GCY, GDA, GDC, GDE})
) -> {ok, list({GCY, GDA, GDC, GDE})} | {error, nil}.
do_strict_zip_4(List, Other_1, Other_2, Other_3, Acc) ->
case {List, Other_1, Other_2, Other_3} of
{[], [], [], []} ->
{ok,
begin
_pipe = Acc,
lists:reverse(_pipe)
end};
{[], _, _, _} ->
{error, nil};
{_, [], _, _} ->
{error, nil};
{_, _, [], _} ->
{error, nil};
{_, _, _, []} ->
{error, nil};
{[A | A_rest], [B | B_rest], [C | C_rest], [D | D_rest]} ->
do_strict_zip_4(
A_rest,
B_rest,
C_rest,
D_rest,
[{A, B, C, D} | Acc]
)
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 338).
-spec strict_zip_4(list(GCN), list(GCP), list(GCR), list(GCT)) -> {ok,
list({GCN, GCP, GCR, GCT})} |
{error, nil}.
strict_zip_4(List, Other_1, Other_2, Other_3) ->
do_strict_zip_4(List, Other_1, Other_2, Other_3, []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 363).
-spec pop(list(GDK)) -> {gleam@option:option(GDK), list(GDK)}.
pop(List) ->
case List of
[] ->
{none, []};
[A | Rest] ->
{{some, A}, Rest}
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 20).
-spec do_zip_longest_2(
list(FUR),
list(FUT),
list({gleam@option:option(FUR), gleam@option:option(FUT)})
) -> list({gleam@option:option(FUR), gleam@option:option(FUT)}).
do_zip_longest_2(List, Other, Acc) ->
case {pop(List), pop(Other)} of
{{none, _}, {none, _}} ->
_pipe = Acc,
lists:reverse(_pipe);
{{A, A_rest}, {B, B_rest}} ->
do_zip_longest_2(A_rest, B_rest, [{A, B} | Acc])
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 13).
-spec zip_longest_2(list(FUK), list(FUM)) -> list({gleam@option:option(FUK),
gleam@option:option(FUM)}).
zip_longest_2(List, Other) ->
do_zip_longest_2(List, Other, []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 101).
-spec do_zip_longest_3(
list(FWJ),
list(FWL),
list(FWN),
list({gleam@option:option(FWJ),
gleam@option:option(FWL),
gleam@option:option(FWN)})
) -> list({gleam@option:option(FWJ),
gleam@option:option(FWL),
gleam@option:option(FWN)}).
do_zip_longest_3(List, Other_1, Other_2, Acc) ->
case {pop(List), pop(Other_1), pop(Other_2)} of
{{none, _}, {none, _}, {none, _}} ->
_pipe = Acc,
lists:reverse(_pipe);
{{A, A_rest}, {B, B_rest}, {C, C_rest}} ->
do_zip_longest_3(A_rest, B_rest, C_rest, [{A, B, C} | Acc])
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 93).
-spec zip_longest_3(list(FVZ), list(FWB), list(FWD)) -> list({gleam@option:option(FVZ),
gleam@option:option(FWB),
gleam@option:option(FWD)}).
zip_longest_3(List, Other_1, Other_2) ->
do_zip_longest_3(List, Other_1, Other_2, []).
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 234).
-spec do_zip_longest_4(
list(FZT),
list(FZV),
list(FZX),
list(FZZ),
list({gleam@option:option(FZT),
gleam@option:option(FZV),
gleam@option:option(FZX),
gleam@option:option(FZZ)})
) -> list({gleam@option:option(FZT),
gleam@option:option(FZV),
gleam@option:option(FZX),
gleam@option:option(FZZ)}).
do_zip_longest_4(List, Other_1, Other_2, Other_3, Acc) ->
case {pop(List), pop(Other_1), pop(Other_2), pop(Other_3)} of
{{none, _}, {none, _}, {none, _}, {none, _}} ->
_pipe = Acc,
lists:reverse(_pipe);
{{A, A_rest}, {B, B_rest}, {C, C_rest}, {D, D_rest}} ->
do_zip_longest_4(
A_rest,
B_rest,
C_rest,
D_rest,
[{A, B, C, D} | Acc]
)
end.
-file("/Users/josephlyons/Projects/Personal/gleam/zipnotic/src/zipnotic.gleam", 225).
-spec zip_longest_4(list(FZG), list(FZI), list(FZK), list(FZM)) -> list({gleam@option:option(FZG),
gleam@option:option(FZI),
gleam@option:option(FZK),
gleam@option:option(FZM)}).
zip_longest_4(List, Other_1, Other_2, Other_3) ->
do_zip_longest_4(List, Other_1, Other_2, Other_3, []).