Packages

A fork of the Gleam standard library for Glistix's Nix target

Current section

Files

Jump to
glistix_stdlib src gleam@pair.erl
Raw

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({XC, any()}) -> XC.
first(Pair) ->
{A, _} = Pair,
A.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 24).
-spec second({any(), XF}) -> XF.
second(Pair) ->
{_, A} = Pair,
A.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 38).
-spec swap({XG, XH}) -> {XH, XG}.
swap(Pair) ->
{A, B} = Pair,
{B, A}.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 53).
-spec map_first({XI, XJ}, fun((XI) -> XK)) -> {XK, XJ}.
map_first(Pair, Fun) ->
{A, B} = Pair,
{Fun(A), B}.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 68).
-spec map_second({XL, XM}, fun((XM) -> XN)) -> {XL, XN}.
map_second(Pair, Fun) ->
{A, B} = Pair,
{A, Fun(B)}.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/pair.gleam", 83).
-spec new(XO, XP) -> {XO, XP}.
new(First, Second) ->
{First, Second}.