Packages

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

Current section

Files

Jump to
glistix_stdlib src gleam@function.erl
Raw

src/gleam@function.erl

-module(gleam@function).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([compose/2, curry2/1, curry3/1, curry4/1, curry5/1, curry6/1, flip/1, identity/1, constant/1, tap/2, apply1/2, apply2/3, apply3/4]).
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 2).
-spec compose(fun((EPH) -> EPI), fun((EPI) -> EPJ)) -> fun((EPH) -> EPJ).
compose(Fun1, Fun2) ->
fun(A) -> Fun2(Fun1(A)) end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 39).
-spec curry2(fun((EPK, EPL) -> EPM)) -> fun((EPK) -> fun((EPL) -> EPM)).
curry2(Fun) ->
fun(A) -> fun(B) -> Fun(A, B) end end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 50).
-spec curry3(fun((EPO, EPP, EPQ) -> EPR)) -> fun((EPO) -> fun((EPP) -> fun((EPQ) -> EPR))).
curry3(Fun) ->
fun(A) -> fun(B) -> fun(C) -> Fun(A, B, C) end end end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 61).
-spec curry4(fun((EPT, EPU, EPV, EPW) -> EPX)) -> fun((EPT) -> fun((EPU) -> fun((EPV) -> fun((EPW) -> EPX)))).
curry4(Fun) ->
fun(A) -> fun(B) -> fun(C) -> fun(D) -> Fun(A, B, C, D) end end end end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 73).
-spec curry5(fun((EPZ, EQA, EQB, EQC, EQD) -> EQE)) -> fun((EPZ) -> fun((EQA) -> fun((EQB) -> fun((EQC) -> fun((EQD) -> EQE))))).
curry5(Fun) ->
fun(A) ->
fun(B) ->
fun(C) -> fun(D) -> fun(E) -> Fun(A, B, C, D, E) end end end
end
end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 85).
-spec curry6(fun((EQG, EQH, EQI, EQJ, EQK, EQL) -> EQM)) -> fun((EQG) -> fun((EQH) -> fun((EQI) -> fun((EQJ) -> fun((EQK) -> fun((EQL) -> EQM)))))).
curry6(Fun) ->
fun(A) ->
fun(B) ->
fun(C) ->
fun(D) -> fun(E) -> fun(F) -> Fun(A, B, C, D, E, F) end end end
end
end
end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 94).
-spec flip(fun((EQO, EQP) -> EQQ)) -> fun((EQP, EQO) -> EQQ).
flip(Fun) ->
fun(B, A) -> Fun(A, B) end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 100).
-spec identity(EQR) -> EQR.
identity(X) ->
X.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 105).
-spec constant(EQS) -> fun((any()) -> EQS).
constant(Value) ->
fun(_) -> Value end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 114).
-spec tap(EQU, fun((EQU) -> any())) -> EQU.
tap(Arg, Effect) ->
Effect(Arg),
Arg.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 135).
-spec apply1(fun((EQW) -> EQX), EQW) -> EQX.
apply1(Fun, Arg1) ->
Fun(Arg1).
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 145).
-spec apply2(fun((EQY, EQZ) -> ERA), EQY, EQZ) -> ERA.
apply2(Fun, Arg1, Arg2) ->
Fun(Arg1, Arg2).
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 155).
-spec apply3(fun((ERB, ERC, ERD) -> ERE), ERB, ERC, ERD) -> ERE.
apply3(Fun, Arg1, Arg2, Arg3) ->
Fun(Arg1, Arg2, Arg3).