Current section
Files
Jump to
Current section
Files
src/gextra@pair.erl
-module(gextra@pair).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([new1/1, new2/1, twin/1, map/2, replace_first/2, replace_second/2]).
-file("/home/joe/Projects/gleam/utils/src/gextra/pair.gleam", 8).
-spec new1(HIU) -> {HIU, nil}.
new1(First) ->
{First, nil}.
-file("/home/joe/Projects/gleam/utils/src/gextra/pair.gleam", 19).
-spec new2(HIV) -> {nil, HIV}.
new2(Second) ->
{nil, Second}.
-file("/home/joe/Projects/gleam/utils/src/gextra/pair.gleam", 30).
-spec twin(HIW) -> {HIW, HIW}.
twin(Value) ->
{Value, Value}.
-file("/home/joe/Projects/gleam/utils/src/gextra/pair.gleam", 42).
-spec map({HIX, HIX}, fun((HIX) -> HIY)) -> {HIY, HIY}.
map(Pair, Map) ->
{Map(erlang:element(1, Pair)), Map(erlang:element(2, Pair))}.
-file("/home/joe/Projects/gleam/utils/src/gextra/pair.gleam", 54).
-spec replace_first({any(), HJA}, HJB) -> {HJB, HJA}.
replace_first(Pair, First) ->
{First, erlang:element(2, Pair)}.
-file("/home/joe/Projects/gleam/utils/src/gextra/pair.gleam", 66).
-spec replace_second({HJC, any()}, HJE) -> {HJC, HJE}.
replace_second(Pair, Second) ->
{erlang:element(1, Pair), Second}.