Initial commit
This commit is contained in:
commit
a6272848f9
379 changed files with 74829 additions and 0 deletions
30
build/dev/javascript/gleam_stdlib/gleam@function.erl
Normal file
30
build/dev/javascript/gleam_stdlib/gleam@function.erl
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
-module(gleam@function).
|
||||
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
|
||||
-define(FILEPATH, "src/gleam/function.gleam").
|
||||
-export([identity/1, tap/2]).
|
||||
|
||||
-if(?OTP_RELEASE >= 27).
|
||||
-define(MODULEDOC(Str), -moduledoc(Str)).
|
||||
-define(DOC(Str), -doc(Str)).
|
||||
-else.
|
||||
-define(MODULEDOC(Str), -compile([])).
|
||||
-define(DOC(Str), -compile([])).
|
||||
-endif.
|
||||
|
||||
-file("src/gleam/function.gleam", 3).
|
||||
?DOC(" Takes a single argument and always returns its input value.\n").
|
||||
-spec identity(CLA) -> CLA.
|
||||
identity(X) ->
|
||||
X.
|
||||
|
||||
-file("src/gleam/function.gleam", 12).
|
||||
?DOC(
|
||||
" Takes an argument and a single function, calls that function with that\n"
|
||||
" argument and returns that argument instead of the function return value.\n"
|
||||
"\n"
|
||||
" Useful for running synchronous side effects in a pipeline.\n"
|
||||
).
|
||||
-spec tap(CLB, fun((CLB) -> any())) -> CLB.
|
||||
tap(Arg, Effect) ->
|
||||
Effect(Arg),
|
||||
Arg.
|
||||
Loading…
Add table
Add a link
Reference in a new issue