Lapis.Error (Lapis v0.2.0)
Composable parsing error.
Error consists of an arbitrary reason and an optional location (path in the input data).
Errors could be concatenated and enumerated.
iex> error = Lapis.Error.new(:bad_integer)
iex> Enum.to_list(error)
[{:bad_integer, []}]
iex> error2 = Lapis.Error.new(:bad_float) |> Lapis.Error.put_loc(:foo)
iex> Enum.to_list(error2)
[{:bad_float, [:foo]}]
iex> Lapis.Error.concat(error, error2) |> Enum.sort()
[{:bad_float, [:foo]}, {:bad_integer, []}]