veloped. :)
On Thu, Dec 15, 2022 at 10:31 PM 'Matt Farabaugh' via elixir-lang-core
mailto:elixir-lang-core@googlegroups.com>>
wrote:
Hi Ben,
I agree that it reduces its applicability, but I see that as a virtue. Filter
and Map are useful despite being less applicable than Reduce, since
might fail on nil anyway. Or maybe a with/1 pipeline might work better
than the pipe operator if you want a succession of happy-path matches?
If we move forward, it might be better to explicitly declare the returned
expression, not just infer it from dangling variables: it isn't obvious what
sho
variables: it isn't obvious what
should `{a, b}` or `{a, b, a}` return. Something like:
{1, 2, 1} |> pattern_filter(b <- {a, b, a})
Le mer. 14 déc. 2022 à 05:50, 'Matt Farabaugh' via elixir-lang-core
a écrit :
All,
I wrote a macro which allows for using a pattern to essentially e
it might be better to explicitly declare the returned
expression, not just infer it from dangling variables: it isn't obvious what
should `{a, b}` or `{a, b, a}` return. Something like:
{1, 2, 1} |> pattern_filter(b <- {a, b, a})
Le mer. 14 déc. 2022 à 05:50, 'Matt Farabaugh' via elixir-lan
ht be better to explicitly declare the returned
expression, not just infer it from dangling variables: it isn't obvious what
should `{a, b}` or `{a, b, a}` return. Something like:
{1, 2, 1} |> pattern_filter(b <- {a, b, a})
Le mer. 14 déc. 2022 à 05:50, 'Matt Farabaugh' via elixir-lang-core
isn't obvious what
should `{a, b}` or `{a, b, a}` return. Something like:
{1, 2, 1} |> pattern_filter(b <- {a, b, a})
Le mer. 14 déc. 2022 à 05:50, 'Matt Farabaugh' via elixir-lang-core
mailto:elixir-lang-core@googlegroups.com>> a
écrit :
All,
I wrote a macro which allows for using a
All,
I wrote a macro which allows for using a pattern to essentially extract a
value from a data structure:
@doc """
Filter a value out of data using a pattern with one variable. Returns a
default value
if no match. Raises if pattern contains no variables or more than one
variable.
##