Current section
Files
Jump to
Current section
Files
src/gleam@pair.erl
-module(gleam@pair).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([first/1, second/1, swap/1, map_first/2, map_second/2, new/2]).
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 10).
-spec first({YM, any()}) -> YM.
first(Pair) ->
{A, _} = Pair,
A.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 24).
-spec second({any(), YP}) -> YP.
second(Pair) ->
{_, A} = Pair,
A.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 38).
-spec swap({YQ, YR}) -> {YR, YQ}.
swap(Pair) ->
{A, B} = Pair,
{B, A}.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 53).
-spec map_first({YS, YT}, fun((YS) -> YU)) -> {YU, YT}.
map_first(Pair, Fun) ->
{A, B} = Pair,
{Fun(A), B}.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 68).
-spec map_second({YV, YW}, fun((YW) -> YX)) -> {YV, YX}.
map_second(Pair, Fun) ->
{A, B} = Pair,
{A, Fun(B)}.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 83).
-spec new(YY, YZ) -> {YY, YZ}.
new(First, Second) ->
{First, Second}.