Current section

Files

Jump to
halo src halo@code.erl
Raw

src/halo@code.erl

-module(halo@code).
-compile([no_auto_import, nowarn_unused_vars]).
-export([modified_modules/0, atomic_load/1, soft_purge/1, soft_purge_all/1, module_name/1, add_paths_internal/1, add_paths/1]).
-spec modified_modules() -> list(halo@modres:module_()).
modified_modules() ->
code:modified_modules().
-spec atomic_load(list(halo@modres:module_())) -> halo@modres:module_result().
atomic_load(Field@0) ->
code:atomic_load(Field@0).
-spec soft_purge(halo@modres:module_()) -> boolean().
soft_purge(Field@0) ->
code:soft_purge(Field@0).
-spec soft_purge_all(list(halo@modres:module_())) -> {ok, nil} |
{error, halo@modres:module_()}.
soft_purge_all(Modules) ->
gleam@list:try_each(Modules, fun(Mod) -> case code:soft_purge(Mod) of
true ->
{ok, nil};
false ->
{error, Mod}
end end).
-spec module_name(halo@modres:module_()) -> binary().
module_name(Field@0) ->
halo_erl:module_name(Field@0).
-spec add_paths_internal(list(gleam@erlang@charlist:charlist())) -> halo@modres:module_result().
add_paths_internal(Field@0) ->
code:add_paths(Field@0).
-spec add_paths(list(binary())) -> halo@modres:module_result().
add_paths(Paths) ->
Paths@1 = begin
_pipe = Paths,
gleam@list:map(_pipe, fun gleam@erlang@charlist:from_string/1)
end,
code:add_paths(Paths@1).