Re: [elixir-core:11797] [Proposal] More compiler warnings for impossible pattern matches (map/struct)

2024-06-10 Thread Tobias Pfeiffer
5, > 83, >116, 114, 117, 99, 116, 8, 95, 95, 105, ...>>, {:key_match, 1}} > iex(2)> MapVsStruct.key_match(%{__struct__: Range}) > "range" > ``` > > So given that I'm not sure we'd want a compilation warning for that > pattern match, so perhaps

Re: [elixir-core:11764] [Proposal] More compiler warnings for impossible pattern matches (map/struct)

2024-05-30 Thread Tobias Pfeiffer
heap > enough to perform. The Erlang/OTP team would know best, so I suggest > proposing those there, if nobody has done that yet. > > > > > On Thu, May 30, 2024 at 3:25 PM Tobias Pfeiffer wrote: > >> Hello everyone, >> >> as usual thanks for all your outs

[elixir-core:11762] [Proposal] More compiler warnings for impossible pattern matches (map/struct)

2024-05-30 Thread Tobias Pfeiffer
Hello everyone, as usual thanks for all your outstanding work on Elixir & everything else. Courtesy of a reddit discussion [1] I'd like to propose implementing some more compiler warnings for matches that are impossible. ## Background Elixir is very programmer friendly and issues compiler

Re: [elixir-core:11266] Force compilation of a single file/files for benchmarking purposes

2023-02-23 Thread Tobias Pfeiffer
You can also force recompilation by defining this function: > > def __mix_recompile__?, do: true > > Wiadomość napisana przez José Valim w dniu > 23.02.2023, o godz. 11:20: > >  > > Could you potentially use `mix run lib/my_file.ex` for those cases? > > On

Re: [elixir-core:11264] Force compilation of a single file/files for benchmarking purposes

2023-02-23 Thread Tobias Pfeiffer
ex` for those cases? > > On Thu, Feb 23, 2023 at 10:27 AM Tobias Pfeiffer wrote: > >> Hi everyone and as always, thanks for your amazing work! >> >> Jokes have been lobbied at me in the spirit of the "breaks my worlfow" >> XKCD [1] - but, please here me

[elixir-core:11261] Force compilation of a single file/files for benchmarking purposes

2023-02-23 Thread Tobias Pfeiffer
Hi everyone and as always, thanks for your amazing work! Jokes have been lobbied at me in the spirit of the "breaks my worlfow" XKCD [1] - but, please here me out! Since the (amazing!) 1.13 [2] elixir semantic recompilation changes I can't easily force recompilation on single files. The best

Re: [elixir-core:10798] [Proposal] Make function return values accessible in Mix.Tasks.Profile.#{Profiler}.profile

2022-02-20 Thread Tobias Pfeiffer
In the spirit of me not promising OSS work and then not doing it (yes I still have mox back of my mind) I did it straight away, as it was also rather easy and I had looked at it today: https://github.com/elixir-lang/elixir/pull/11657 Thanks for the quick answer! José Valim schrieb am Sonntag,

[elixir-core:10795] [Proposal] Make function return values accessible in Mix.Tasks.Profile.#{Profiler}.profile

2022-02-20 Thread Tobias Pfeiffer
Hey everyone, I'm finally working on a new Benchee release that will include profiling after benchmark runs. I did notice one problem, using the programmatic interface of the tasks (like: https://hexdocs.pm/mix/main/Mix.Tasks.Profile.Eprof.html#profile/2) it only prints the report but doesn't

Re: [elixir-core:7862] Proposal: Add assert_received_exactly to ExUnit

2018-02-11 Thread Tobias Pfeiffer
> wrote: > > How is that different from asserting each of them was received > followed by a refute_received _? My concern about such helper is > that it may imply an ordering which we likely won’t assert. Although > one could argue the same about multiple assert_rece

Re: [elixir-core:7860] Proposal: Add assert_received_exactly to ExUnit

2018-02-11 Thread Tobias Pfeiffer
gt; imply an ordering which we likely won’t assert. Although one could argue > the same about multiple assert_received calls. > > On Sun, Feb 11, 2018 at 16:04 Tobias Pfeiffer <prag...@gmail.com > <mailto:prag...@gmail.com>> wrote: > > Hello everyone, > > I've

[elixir-core:7858] Proposal: Add assert_received_exactly to ExUnit

2018-02-11 Thread Tobias Pfeiffer
Hello everyone, I've happily been using a little helper for quite some time and Devon liked it as well so thought might propose it: I often want to make sure that a bunch of messages were received but exactly these messages and no more. Enter assert_received_exactly - it gets a list of expected

Re: [elixir-core:6587] Suggestion: Map.deep_merge

2016-11-11 Thread Tobias Pfeiffer
of the same kind. This way someone can easily get deep merging for structs by adding "@derive DeepMerge.Resolver". *José Valim* www.plataformatec.com.br <http://www.plataformatec.com.br/> Skype: jv.ptec Founder and Director of R On Thu, Nov 10, 2016 at 8:53 PM, Tobias Pfeiffer &l

Re: [elixir-core:6585] Suggestion: Map.deep_merge

2016-11-10 Thread Tobias Pfeiffer
Tobi On 10/19/2016 03:17 PM, Tobias Pfeiffer wrote: Hey y'all! Sorry for the resurrection but due to circumstances I just got to finish and clean up my implementation with docs et. al. now. I sent a PR to elixir as most people here seemed to agree it was a good idea but the discussion went

Re: [elixir-core:6482] Suggestion: Map.deep_merge

2016-10-19 Thread Tobias Pfeiffer
ems like you could have a Map.deep_merge/2 which has an explicit > behavior for conflicting keys (e.g. first wins or second wins), and a > Map.deep_merge/3 which also accepts a function to merge individual keys. > > -bt > > On Sat, Sep 10, 2016 at 1:47 AM, Tobias Pfeiff

Re: [elixir-core:6302] Suggestion: Map.deep_merge

2016-09-10 Thread Tobias Pfeiffer
On 09/09/2016 06:00 PM, OvermindDL1 wrote: > On Friday, September 9, 2016 at 9:25:05 AM UTC-6, OvermindDL1 wrote: > > > I looked through my big project to see a couple of areas where I > deep-merge, in all cases I needed a resolver function (usually appending > lists together or sorting something

Re: [elixir-core:6300] Re: Suggestion: Map.deep_merge

2016-09-09 Thread Tobias Pfeiffer
hough rare, it could be useful. > Unsure about it in core but in a library definitely. > > On Tuesday, September 6, 2016 at 9:20:23 AM UTC-6, Tobias Pfeiffer > wrote: > > Hi everyone, > > in Elixir we work a lot with maps (or at least I do :D). And we >

[elixir-core:6291] Suggestion: Map.deep_merge

2016-09-06 Thread Tobias Pfeiffer
Hi everyone, in Elixir we work a lot with maps (or at least I do :D). And we know and love Map.merge. However given a map like %{a: %{b: 1}} and we want to merge it with a map like %{a: %{c: 2}} then the :a key will be totally overridden with whatever is supplied in the other map. However, for