Initial commit
This commit is contained in:
commit
a6272848f9
379 changed files with 74829 additions and 0 deletions
17
build/dev/javascript/gleam_stdlib/gleam/function.mjs
Normal file
17
build/dev/javascript/gleam_stdlib/gleam/function.mjs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Takes a single argument and always returns its input value.
|
||||
*/
|
||||
export function identity(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an argument and a single function, calls that function with that
|
||||
* argument and returns that argument instead of the function return value.
|
||||
*
|
||||
* Useful for running synchronous side effects in a pipeline.
|
||||
*/
|
||||
export function tap(arg, effect) {
|
||||
effect(arg);
|
||||
return arg;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue