[elixir-core:5914] Proposal: Map.filter_values and Map.filter_keys

2016-06-18 Thread Filip Haglund
I wish there was a Map.filter_values function that would filter on keys or values, but leave the other one intact. This seems like something that should be in the standard library. Example implementation of a Map.filter_values that would filter a map based on its values, leaving the keys intact

[elixir-core:5916] Re: Proposal: Map.filter_values and Map.filter_keys

2016-06-18 Thread Filip Haglund
ere's already Map.take/2 which is somewhat similar in functionality to filter_keys. On Saturday, June 18, 2016 at 6:27:07 PM UTC+2, Filip Haglund wrote: > > I wish there was a Map.filter_values function that would filter on keys or > values, but leave the other one intact. This s

[elixir-core:5917] Re: Proposal: Map.filter_values and Map.filter_keys

2016-06-18 Thread Filip Haglund
7 PM UTC+2, Filip Haglund wrote: > > I wish there was a Map.filter_values function that would filter on keys or > values, but leave the other one intact. This seems like something that > should be in the standard library. > > Example implementation of a Map.filter_values that w

[elixir-core:5937] Re: Proposal: Map.filter_values and Map.filter_keys

2016-06-22 Thread Filip Haglund
damage it might do by leading people away from Enum. On Saturday, June 18, 2016 at 6:27:07 PM UTC+2, Filip Haglund wrote: > > I wish there was a Map.filter_values function that would filter on keys or > values, but leave the other one intact. This seems like something that > sho

[elixir-core:5986] Re: Proposal: String.longer?

2016-06-26 Thread Filip Haglund
Could this be done automatically by the compiler? Replacing `String.length str >= 13` with `String.at(str, 13) != nil`? On Saturday, June 25, 2016 at 4:54:26 PM UTC+2, Alvin Lindstam wrote: > > Checking the length of a String requires traversing the whole string. I > fairly common use case is ch

[elixir-core:5987] Re: Proposal: Rename lhs and rhs

2016-06-26 Thread Filip Haglund
Right could be confused with correct. If the changes happens, make sure the lines still line up, i.e. add an extra space after "left". On Sunday, June 26, 2016 at 6:38:33 AM UTC+2, Antonio Cangiano wrote: > > Elixir tends to score quite well on the usability scale, however, > displaying lhs and

[elixir-core:5988] Access behaviour for lists and tuples?

2016-06-26 Thread Filip Haglund
Why aren't lists and tuples implementing `Access`? {:a, :b, :c}[1] == :b -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@goog

Re: [elixir-core:5991] Re: Proposal: Rename lhs and rhs

2016-06-26 Thread Filip Haglund
west/east? :) On Sunday, June 26, 2016 at 6:17:49 PM UTC+2, ...Paul wrote: > > On Sun, Jun 26, 2016 at 9:12 AM, Filip Haglund > wrote: > >> Right could be confused with correct. If the changes happens, make sure >> the lines still line up, i.e. add an extra space after

[elixir-core:5994] Re: Access behaviour for lists and tuples?

2016-06-27 Thread Filip Haglund
Would it hurt to add it? On Sunday, June 26, 2016 at 6:16:19 PM UTC+2, Filip Haglund wrote: > > Why aren't lists and tuples implementing `Access`? > > {:a, :b, :c}[1] == :b > > > -- You received this message because you are subscribed to the Google Groups &q

Re: [elixir-core:5998] Re: Access behaviour for lists and tuples?

2016-06-27 Thread Filip Haglund
d be careful to steer new users away > from techniques that are inefficient or not idiomatic. > > Cheers, > Louis > > On 27 June 2016 at 16:22, Filip Haglund > > wrote: > > Would it hurt to add it? > > > > On Sunday, June 26, 2016 at 6:16:19 PM UTC

[elixir-core:6040] Proposal: Sort ExUnit output by line number and file path

2016-07-06 Thread Filip Haglund
I'd like ExUnit to sort its output by source code line number and path. This simplifies fixing multiple test cases in a row, when that's what you're doing, and it shouldn't slow down other development. If it would noticeably slow down parallell testing, only sorting output when `--max-cases 1`

Re: [elixir-core:6042] Proposal: Sort ExUnit output by line number and file path

2016-07-06 Thread Filip Haglund
x27;t sort the failure output. > > > > *José Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Wed, Jul 6, 2016 at 7:07 PM, Filip Haglund > wrote: > >> I'd like ExUnit to sort its output by source code line number and pat

Re: [elixir-core:6044] Proposal: Sort ExUnit output by line number and file path

2016-07-06 Thread Filip Haglund
he > same order as the one defined in your test module. Why is that not enough? > > > *José Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Wed, Jul 6, 2016 at 8:54 PM, Filip Haglund > wrote: > >> That's a good

[elixir-core:6160] Proposal: Golang's defer statement for cleanup of side-effects

2016-08-05 Thread Filip Haglund
I often find myself writing def func(a,b): g = :digraph.new ... out = some_long_multiline_expression_using_g :digraph.delete g out end when working with graphs. The distance between `:digraph.new` and `:digraph.delete` makes it harder to remember to clean up the graph ets tables. T

[elixir-core:6791] Pipeline-firendly variable assignment

2017-01-01 Thread Filip Haglund
I love the flow of how pipelines read top-down as a series of steps, but there's something I don't like about it; having to look back at the start of the pipeline again to see in what variable the result is stored. It's an uncanny valley; reading functional code top-down is really clear and easy