Current section
Files
Jump to
Current section
Files
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((ETW) -> ETX), fun((ETX) -> ETY)) -> fun((ETW) -> ETY).
compose(Fun1, Fun2) ->
fun(A) -> Fun2(Fun1(A)) end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 40).
-spec curry2(fun((ETZ, EUA) -> EUB)) -> fun((ETZ) -> fun((EUA) -> EUB)).
curry2(Fun) ->
fun(A) -> fun(B) -> Fun(A, B) end end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 51).
-spec curry3(fun((EUD, EUE, EUF) -> EUG)) -> fun((EUD) -> fun((EUE) -> fun((EUF) -> EUG))).
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", 62).
-spec curry4(fun((EUI, EUJ, EUK, EUL) -> EUM)) -> fun((EUI) -> fun((EUJ) -> fun((EUK) -> fun((EUL) -> EUM)))).
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", 74).
-spec curry5(fun((EUO, EUP, EUQ, EUR, EUS) -> EUT)) -> fun((EUO) -> fun((EUP) -> fun((EUQ) -> fun((EUR) -> fun((EUS) -> EUT))))).
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", 86).
-spec curry6(fun((EUV, EUW, EUX, EUY, EUZ, EVA) -> EVB)) -> fun((EUV) -> fun((EUW) -> fun((EUX) -> fun((EUY) -> fun((EUZ) -> fun((EVA) -> EVB)))))).
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", 95).
-spec flip(fun((EVD, EVE) -> EVF)) -> fun((EVE, EVD) -> EVF).
flip(Fun) ->
fun(B, A) -> Fun(A, B) end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 101).
-spec identity(EVG) -> EVG.
identity(X) ->
X.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 106).
-spec constant(EVH) -> fun((any()) -> EVH).
constant(Value) ->
fun(_) -> Value end.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 115).
-spec tap(EVJ, fun((EVJ) -> any())) -> EVJ.
tap(Arg, Effect) ->
Effect(Arg),
Arg.
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 136).
-spec apply1(fun((EVL) -> EVM), EVL) -> EVM.
apply1(Fun, Arg1) ->
Fun(Arg1).
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 146).
-spec apply2(fun((EVN, EVO) -> EVP), EVN, EVO) -> EVP.
apply2(Fun, Arg1, Arg2) ->
Fun(Arg1, Arg2).
-file("/home/pgbiel/GitHub/glistix_stdlib/src/gleam/function.gleam", 156).
-spec apply3(fun((EVQ, EVR, EVS) -> EVT), EVQ, EVR, EVS) -> EVT.
apply3(Fun, Arg1, Arg2, Arg3) ->
Fun(Arg1, Arg2, Arg3).