- Rename Gleam module from encoding_simple to encoding - Move Gleam files from src/aprs/ to src/aprsme/ to match project namespace - Create custom Mix task for Gleam compilation (lib/mix/tasks/gleam_compile.ex) - Update EncodingUtils to wrap Gleam implementation instead of pure Elixir - Add Gleam dependencies to mix.exs and configure build paths - Update Mix aliases to include Gleam compilation in test and compile tasks - Add Gleam support to GitHub Actions CI workflow with caching - Add GLEAM_INTEGRATION.md documentation - All 357 tests passing with Gleam integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
914 B
Erlang
30 lines
914 B
Erlang
-module(gleam@function).
|
|
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
|
|
-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(CNY) -> CNY.
|
|
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(CNZ, fun((CNZ) -> any())) -> CNZ.
|
|
tap(Arg, Effect) ->
|
|
Effect(Arg),
|
|
Arg.
|