Packages

A Gleam library for Korean text processing, providing comprehensive tools for handling Hangul characters

Current section

Files

Jump to
hanguleam src hanguleam@internal@utils.erl
Raw

src/hanguleam@internal@utils.erl

-module(hanguleam@internal@utils).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-define(FILEPATH, "src/hanguleam/internal/utils.gleam").
-export([get_value_by_index/2, find_index/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.
?MODULEDOC(false).
-file("src/hanguleam/internal/utils.gleam", 3).
?DOC(false).
-spec get_value_by_index(integer(), list(binary())) -> {ok, binary()} |
{error, nil}.
get_value_by_index(Index, Value_list) ->
_pipe = Value_list,
_pipe@1 = gleam@list:drop(_pipe, Index),
gleam@list:first(_pipe@1).
-file("src/hanguleam/internal/utils.gleam", 10).
?DOC(false).
-spec find_index(list(ODX), ODX) -> {ok, integer()} | {error, nil}.
find_index(List, Target) ->
_pipe = List,
gleam@list:index_fold(
_pipe,
{error, nil},
fun(Acc, Item, Index) -> case Acc of
{ok, _} ->
Acc;
{error, _} when Item =:= Target ->
{ok, Index};
{error, _} ->
Acc
end end
).