Skip to content

Commit

Permalink
Remove unused private macros
Browse files Browse the repository at this point in the history
  • Loading branch information
hissssst committed Mar 30, 2024
1 parent fe47146 commit c9bb84b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
35 changes: 0 additions & 35 deletions lib/pathex/lenses/all.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,6 @@ defmodule Pathex.Lenses.All do

# Helpers

defmacrop at_pattern(pipe, pattern, do: code) do
quote do
case unquote(pipe) do
unquote(pattern) -> unquote(code)
other -> other
end
end
end

defmacrop cont(func, value, acc) do
quote do
case unquote(func).(unquote(value)) do
{:ok, v} -> {:cont, {:ok, [v | unquote(acc)]}}
:error -> {:halt, :error}
end
end
end

defmacrop reverse_if_ok(res) do
quote do
with {:ok, l} <- unquote(res) do
{:ok, :lists.reverse(l)}
end
end
end

defmacrop bool_to_either(bool, ok) do
quote do
case unquote(bool) do
true -> {:ok, unquote(ok)}
false -> :error
end
end
end

defmacrop wrap_ok(code) do
quote(do: {:ok, unquote(code)})
end
Expand Down
9 changes: 0 additions & 9 deletions lib/pathex/lenses/star.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ defmodule Pathex.Lenses.Star do

# Helpers

defmacrop extend_if_ok(status, func, value, acc) do
quote do
case unquote(func).(unquote(value)) do
{:ok, result} -> {:ok, [result | unquote(acc)]}
:error -> {unquote(status), unquote(acc)}
end
end
end

defmacrop wrap_ok(code) do
quote(do: {:ok, unquote(code)})
end
Expand Down

0 comments on commit c9bb84b

Please sign in to comment.