Re: [elixir-core:11746] Am I the only one confused with the receive/after pattern — it feels like an anti-pattern.

2024-05-06 Thread 'Andrey Yugai' via elixir-lang-core
In my not so long professional experience with elixir, you don't write bare receive/after, usually it comes in some form of genserver callbacks. I agree that after clause not being pattern matching is confusing, but it's a fair trade-off to keep language at least visually consistent, and also

Re: [elixir-core:11721] Performance of local function capture

2024-03-26 Thread 'Rudolf Manusadzhian' via elixir-lang-core
lang/otp/pull/6963. > > > Le dim. 24 mars 2024 à 01:50, 'Rudolf Manusadzhian' via elixir-lang-core < > elixir-l...@googlegroups.com> a écrit : > >> Hi there! Might be a naive question. >> >> Why don't we treat all local captures as external? Like at compile time,

Re: [elixir-core:11721] Performance of local function capture

2024-03-26 Thread 'Rudolf Manusadzhian' via elixir-lang-core
ne > remains very small: https://github.com/erlang/otp/pull/6963. > > > Le dim. 24 mars 2024 à 01:50, 'Rudolf Manusadzhian' via elixir-lang-core < > elixir-l...@googlegroups.com> a écrit : > >> Hi there! Might be a naive question. >> >> Why don't w

Re: [elixir-core:11721] Performance of local function capture

2024-03-26 Thread 'Rudolf Manusadzhian' via elixir-lang-core
21f3b19f8af9d9d63a30618cdafeaa6367883#diff-3a3b83d8acad1d3b6faed87ba471843f4424b22c26c179bf1d86a87a880e8223R74-R93 > > Even though, as far as I know, recent versions of Erlang > have optimizations to make sure the overhead of lambdas like this one > remains very small: https://github.com/erlang/otp/pull/6963. > > > Le dim. 2

[elixir-core:11719] Performance of local function capture

2024-03-23 Thread 'Rudolf Manusadzhian' via elixir-lang-core
ch/4 <https://hexdocs.pm/telemetry/1.2.1/telemetry.html#attach/4> and the suggestion to avoid using *local* captures raise that thought. If that's not possible, does it make sense to add a note in the docs Kernel.SpecialForms.&/1 # Capture <https://hexdocs.pm/elixir/1.16.2/Kernel.Spec

Re: [elixir-core:11715] Why no ternary expression?

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
l. Best regards, Oliver On Saturday, January 27, 2024 at 7:08:20 PM UTC+1 gva...@gmail.com wrote: > On Jan 26, 2024, at 10:52 PM, Robert Viragh wrote: > > > > As a user of Elixir, it seems to me that I can write ternary expressions > in Elixir by treating the if statement as an e

Re: [elixir-core:11714] [Proposal] Adding Access.find/1

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
` in the future to mirror `at!` as well. > > On Wed, Mar 20, 2024 at 12:00 PM 'oliver....@googlemail.com' via > elixir-lang-core wrote: > >> This is what I found: >> >> From the original PR: https://github.com/elixir-lang/elixir/pull/6634 >> (this has a len

Re: [elixir-core:11712] [Proposal] Adding Access.find/1

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
This is what I found: >From the original PR: https://github.com/elixir-lang/elixir/pull/6634 (this has a lengthy discussion on the merits). The original discussion about including both: https://groups.google.com/g/elixir-lang-core/c/LlZCz0iYgfc/m/5XLRvg8XAgAJ (not very detailed, discuss

Re: [elixir-core:11710] [Proposal] Adding Access.find/1

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
r`. > I think it would be a nice addition as it can express operations that > would be quite verbose otherwise. > > Le mer. 20 mars 2024 à 02:30, 'oliver@googlemail.com' via > elixir-lang-core a écrit : > > Hi. > > I already made a PR but was redirected here. ;-) >

[elixir-core:11707] [Proposal] Adding Access.find/1

2024-03-19 Thread 'oliver....@googlemail.com' via elixir-lang-core
: 10}, %{name: "francine", salary: 30}] iex> get_in(list, [Access.find(&(&1.salary >= 50)), :name]) nil iex> get_and_update_in(list, [Access.find(&(&1.salary >= 50)), :name], fn prev -> ...> {prev, String.upcase(prev)

Re: [elixir-core:11703] Performance of regular expression matches

2024-03-15 Thread 'marcel...@googlemail.com' via elixir-lang-core
I quickly checked how a persistent term cached implementation would compare, which turned out to perform almost equivalent. It seems the :re.version and :erlang.system_info(:endian) values are already cached. ```elixir defmodule RegexPersistent do def version do case :persistent_term.get

Re: [elixir-core:11700] Performance of regular expression matches

2024-03-15 Thread 'marcel...@googlemail.com' via elixir-lang-core
The benchmark results I'm getting are indeed not as dramatic as the fprof results, but on the other hand also more than the 5% mentioned in the PR which introduced the check: https://github.com/elixir-lang/elixir/pull/9040 ```elixir regex = ~r/^([a-z][a-z0-9\+\-\.]*):/i re_pattern

Re: [elixir-core:11696] Performance of regular expression matches

2024-03-14 Thread 'marcel...@googlemail.com' via elixir-lang-core
in `Regex.safe_run/3` (https://github.com/elixir-lang/elixir/blob/b8fca42e58850b56f65d0fb8a2086f2636141f61/lib/elixir/lib/regex.ex#L533) still performs the `:erlang.system_info/0` call. On Thursday 14 March 2024 at 17:15:40 UTC+1 jan.k...@gmail.com wrote: > I read the commit, and I do

Re: [elixir-core:11685] [Proposal] Add `shift/2-3` to calendar types

2024-03-06 Thread 'Theo Fiedler' via elixir-lang-core
Right, it would make using a Duration in combination with the `add/2-3` functions much harder than it needs to be. So far all time units in Elixir are singular, and I think we do gain something from consistently sticking to that, regardless of the context of durations, calendar types and what

Re: [elixir-core:11683] [Proposal] Add `shift/2-3` to calendar types

2024-03-06 Thread 'Theo Fiedler' via elixir-lang-core
gt;> * Postgrex, Explorer, CLDR, etc all implement their own version of >>>> durations >>>> >>>> Arguments for not having it in core: it happens that all of the >>>> arguments above can also be solved without adding Duration to Elixir and, &

[elixir-core:11677] [Proposal] Add `shift/2-3` to calendar types

2024-03-06 Thread 'Theo Fiedler' via elixir-lang-core
a few examples: - https://github.com/elixir-lang/elixir/pull/10199 - https://elixirforum.com/t/get-date-n-months-years-in-the-past/48346/3 - https://elixir-lang.slack.com/archives/C0HEX82NR/p1709581478427009?thread_ts=1709368588.334759=C0HEX82NR Furthermore the shift behaviour in the extremely

Re: [elixir-core:11614] [Proposal] Suggestion for the "mix new" task - git support

2023-12-26 Thread 'Andrey Yugai' via elixir-lang-core
a common use case for someone starting a new project. > > If being git specific is an issue, could be just --vcs. > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and

Re: [elixir-core:11575] [Proposal] support directories in `external_resource`

2023-10-22 Thread 'Alexander Steppke' via elixir-lang-core
t; > —Andrew > > On October 19, 2023, elixir-lang-core > wrote: > > We have a need to trigger recompilation of a module when any file inside a > directory is added or removed since we add the list of files at compilation > time as a module attribute which is used in guard

[elixir-core:11563] [Proposal] support directories in `external_resource`

2023-10-19 Thread 'Alexander Steppke' via elixir-lang-core
directory, but there might be better ways to do this. If there is another already existing way to achieve the same please let me know, maybe I'm just missing something! Best regards, Alex. -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.

Re: [elixir-core:11535] Support using brackets to access an index of a list

2023-09-21 Thread 'Justin Wood' via elixir-lang-core
nt you are looking for resides. This means that random access is constant time or O(1) if you prefer. Having a convenient syntax for this makes sense since the time complexity is so low. Linked lists, which Elixir and Erlang use, are not necessarily stored as a single contiguous block of

Re: [elixir-core:11531] Support using brackets to access an index of a list

2023-09-21 Thread 'Justin Wood' via elixir-lang-core
> It was pointed out that perhaps we don't do this to express that indexing a > list is not fast in Elixir like it is in other languages, but I'm not sure if > that is sufficient reason IMO to leave out a typically very standard feature > of lists. > > Thoughts? Can y

Re: [elixir-core:11528] [proposal] Elixir For GSOC 2024

2023-09-20 Thread 'Andrey Yugai' via elixir-lang-core
: > Elixir for https://hacktoberfest.com/? ? > [September is the perfect time to prepare for Hacktoberfest. Get a jump start > by finding projects to contribute to, adding the ‘hacktoberfest’ tag to your > projects, or familiarizing yourself with Git.](https://hacktoberfest.com/) &g

Re: [elixir-core:11526] Show how many tests were actually run

2023-09-19 Thread 'eksperimental' via elixir-lang-core
any were executed > successfully instead: > 7 tests, 1 failure, 1 passed, 1 excluded, 4 invalid > > I didn't want to open a PR without your feedback but here is some POC > https://github.com/elixir-lang/elixir/compare/main...iaguirre88:elixir:report-number-of-executed-tests?expand

Re: [elixir-core:11454] [Proposal] Overload capture operator to support tagged variable captures

2023-06-28 Thread 'Justin Wood' via elixir-lang-core
ok at this syntax and say "This is field punning". I would have no intuition what is going on. Speaking as someone that has a decent amount of Elixir experience, $"bar" looks like it should be closer in functionality to :"bar" than field punning. Or maybe even similar to usi

Re: [elixir-core:11431] [Proposal] Syntax sugar for Maps construction and pattern matching

2023-06-26 Thread 'Justin Wood' via elixir-lang-core
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...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang

Re: [elixir-core:11422] [Proposal] As-patterns from haskell

2023-06-07 Thread 'Andrey Yugai' via elixir-lang-core
Could you provide an elixir example with proposed new syntax, for those who is not familiar with haskell? Original Message On 8 Jun 2023, 11:36, Corvo Liu wrote: > In haskell there's a syntax sugar called as pattern. For example: > > ``` > f (x:xs) = x:x:xs >

[elixir-core:11416] Re: [Proposal] Create new Registry functions to allow arbitrary PID registration

2023-05-26 Thread 'Noah Betzen' via elixir-lang-core
Disregard, José explained that this isn't possible because of the two ETS tables that Registry uses under the hood. Oh well.  On Friday, May 26, 2023 at 1:12:26 PM UTC-7 Noah Betzen wrote: I made a PR that implements this: https://github.com/elixir-lang/elixir/pull/12609 On Friday, May 26

[elixir-core:11415] Re: [Proposal] Create new Registry functions to allow arbitrary PID registration

2023-05-26 Thread 'Noah Betzen' via elixir-lang-core
I made a PR that implements this: https://github.com/elixir-lang/elixir/pull/12609 On Friday, May 26, 2023 at 10:39:28 AM UTC-7 Noah Betzen wrote: > Erlang's process group module allows adding arbitrary PIDs to a group, > which can be used for things like PubSub: > https://www.erlan

[elixir-core:11414] [Proposal] Create new Registry functions to allow arbitrary PID registration

2023-05-26 Thread 'Noah Betzen' via elixir-lang-core
/elixir/1.14.5/Registry.html#register/3 However, there are ways to work around this with Registry; see attached Livebook markdown for an example. I propose new functions: - Registry.register/4 - register(pid, registry, key, value) - Registry.unregister/3 - unregister(pid

Re: [elixir-core:11408] [Proposal] Add function average or avg to Enum module.

2023-05-22 Thread 'Andrey Yugai' via elixir-lang-core
will be happy to implement it. > > Example: > > iex> Enum.avg(0..10) > 5 > > -- > 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 a

[elixir-core:11320] mix deps.sync

2023-03-17 Thread 'Neil Lyons' via elixir-lang-core
age 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...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-co

Re: [elixir-core:11266] [Question] :math module

2023-02-23 Thread 'Andrey Yugai' via elixir-lang-core
There's not so much elixir can do to improve erlang's :math​, it's already [implemented](https://github.com/erlang/otp/blob/master/lib/stdlib/src/math.erl)with NIFs. Rewriting it in pure elixir/erlang would only degrade performance. Other question is why doesn't :math​ have more functions? BEAM

Re: [elixir-core:11259] [Proposal] setup_all block inside describe block

2023-02-12 Thread 'eksperimental' via elixir-lang-core
block *setup*. > > Thoughts? > -- 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...@googlegroups.com. To vie

Re: [elixir-core:11258] [Proposal] setup_all block inside describe block

2023-02-12 Thread 'eksperimental' via elixir-lang-core
block *setup*. > > Thoughts? > -- 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...@googlegroups.com. To vi

Re: [elixir-core:11253] [proposal] ExUnit: A use case for specifying setup callback as MF(A)

2023-02-05 Thread 'eksperimental' via elixir-lang-core
addition? > > Including the arity would be more conventional, of course, but it's a > bit redundant here. > > At quick glance, it does seem feasible, but it changes the API and I > might be missing other caveats, so I'm not sure. > -- You received this message beca

Re: [elixir-core:11236] [Proposal] Add macro is_real_map

2023-01-03 Thread 'Andrey Yugai' via elixir-lang-core
, Jay Rogov wrote: > Also note that there's is_map_key/2 guard that serves the same purpose when > used as `is_map_key(arg, :__struct__)`, allowing only maps but not structures: > https://hexdocs.pm/elixir/1.14.2/Kernel.html#is_map_key/2 > > On Thursday, 22 December 2022 at 4:22:30

Re: [EXTERNAL] Re: [elixir-core:11224] [proposal] Use patterns to filter data (good for pipes)

2022-12-15 Thread 'Matt Farabaugh' via elixir-lang-core
houghtful feedback I gained from you and the others who replied! I’m glad to be working in Elixir. From: on behalf of José Valim Reply-To: "elixir-lang-core@googlegroups.com" Date: Thursday, December 15, 2022 at 4:58 PM To: "elixir-lang-core@googlegroups.com" Subject: Re

Re: [EXTERNAL] Re: [elixir-core:11221] [proposal] Use patterns to filter data (good for pipes)

2022-12-15 Thread 'Matt Farabaugh' via elixir-lang-core
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 they are simpler. Matt F From: on behalf of Ben Wilson Reply-To: "elixir-lang-core@googlegroups.com" Date: Thursday, Decembe

Re: [EXTERNAL] Re: [elixir-core:11219] [proposal] Use patterns to filter data (good for pipes)

2022-12-15 Thread 'Matt Farabaugh' via elixir-lang-core
_a, b}) # 3 # or {1, 2, 3} |> pattern_filter({1, a, _}) # 2 # would both work ``` The shape of the return is stereotyped, so it is simpler than `then`. I will put the code up on github and share! Thanks, Matt F From: on behalf of Ben Wilson Reply-To: "elixir-lang-core@googlegrou

Re: [EXTERNAL] Re: [elixir-core:11217] [proposal] Use patterns to filter data (good for pipes)

2022-12-15 Thread 'Matt Farabaugh' via elixir-lang-core
disagreement? Thanks! Matt F From: on behalf of Sabiwara Yukichi Reply-To: "elixir-lang-core@googlegroups.com" Date: Tuesday, December 13, 2022 at 6:55 PM To: "elixir-lang-core@googlegroups.com" Subject: [EXTERNAL] Re: [elixir-core:11213] [proposal] Use patterns to filter

Re: [EXTERNAL] Re: [elixir-core:11216] [proposal] Use patterns to filter data (good for pipes)

2022-12-14 Thread 'Matt Farabaugh' via elixir-lang-core
” anymore but “restructure”. I think it’d be somewhat verbose for the use cases I had in mind for `pattern_filter`, but would make for a nice new way to pattern match! From: on behalf of Jay Rogov Reply-To: "elixir-lang-core@googlegroups.com" Date: Wednesday, December 14, 2022 a

Re: [EXTERNAL] Re: [elixir-core:11214] [proposal] Use patterns to filter data (good for pipes)

2022-12-13 Thread 'Matt Farabaugh' via elixir-lang-core
* This does raise a warning, though I’m not sure why the warning is issued for a pattern like this. It just kind of (politely) tells me to remove the underscores, though the code works as intended. From: on behalf of Sabiwara Yukichi Reply-To: "elixir-lang-core@googlegroups.com"

[elixir-core:11211] [proposal] Use patterns to filter data (good for pipes)

2022-12-13 Thread 'Matt Farabaugh' via elixir-lang-core
) no match of right hand side value: {1, 2, 3} """ This is my first proposal. Please let me know if this idea is worth some attention, and how I might better do my part to present it. I have code obviously but I'm not sure this is the place for it. Thanks, Matt F -- You received this

Re: [elixir-core:11208] Reason for DateTime not includes larger units like minutes, hours, days?

2022-12-12 Thread 'Andrey Yugai' via elixir-lang-core
lta = timedelta( days=50, seconds=27, > microseconds=10, milliseconds=29000, minutes=5, hours=8, weeks=2) > ``` > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop rece

Re: [elixir-core:11030] [Proposal] Add "into" keyword to ecto query expression

2022-08-31 Thread 'Andrey Yugai' via elixir-lang-core
I wouldn't claim this is a good idea because `into` in your example looks like leakage of app logic into DB level. If you're only ought to create user id - user map, it is pretty easy to do in Elixir from just a list of users. If you concerned about memory/time, you could try streaming from

[elixir-core:11001] [Proposal] URI.put_query/1 (and put_host/1, etc.?)

2022-07-29 Thread 'Adam Millerchip' via elixir-lang-core
Inspired by this Stack Overflow post: https://stackoverflow.com/questions/49508509/idiom-to-construct-a-uri-with-a-query-string-in-elixir/72223901 I thought it might be useful to have helpers to update the struct fields, rather than manipulating the struct directly. Instead of: %URI{uri | host

Re: [elixir-core:10976] Proposal: New function on List module

2022-07-15 Thread 'eksperimental' via elixir-lang-core
e list. > > iex(1)> List.includes_sublist?([1,2,3,4,5], [2,3]) > true > > iex(1)> List.includes_sublist?([1,2,3,4,5], [1,2]) > true > > iex(1)> List.includes_sublist?([1,2,3,4,5], [3,4,5]) > true > > iex(1)> List2.includes_sublist?([1,2,3,4,5],

Re: [elixir-core:10957] [Proposal] Add Enum.none?/2

2022-06-22 Thread 'eksperimental' via elixir-lang-core
dard library. I don't think that things only belong in the std > > library if the std library offers an optimization. Sometimes the > > important context is that the std library *doesn't* offer an > > optimization. Personally, I believe things like `Enum.none?/2` > > belong in the s

Re: [elixir-core:10952] `Map.get/3` to return default value for `nil` value

2022-06-22 Thread 'Andrey Yugai' via elixir-lang-core
led my `Map.get/3` would be > better. > > `Map.get(map, key, default_value)` looks better than `Map.get(map, key) || > default_value` > > On Wed, Jun 22, 2022 at 11:32 AM 'Andrey Yugai' via elixir-lang-core > wrote: > >> For this behavior I think you'd be better of

Re: [elixir-core:10950] `Map.get/3` to return default value for `nil` value

2022-06-22 Thread 'Andrey Yugai' via elixir-lang-core
key => value} -> > value > > %{} -> > default > > other -> > :erlang.error({:badmap, other}, [map, key, default]) > end > end > ``` > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core

Re: [elixir-core:10936] [Proposal] Add Enum.none?/2

2022-06-18 Thread 'Andrey Yugai' via elixir-lang-core
in all cases. > Example: > If we have [false, true], !Enum.all?/1 will be true, but Enum.none?/1 will be > false > > I would like your thoughts on this one. > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" grou

[elixir-core:10933] [Proposal] Add Scala-like @tailrec annotation for recursive fns

2022-06-15 Thread 'vmrc' via elixir-lang-core
Scala has a handy @tailrec annotation <https://www.scala-lang.org/api/2.12.1/scala/annotation/tailrec.html> that makes the compiler error out if the function is not amenable to tail call optimization. One possible footgun while learning Elixir and recursion is trying to implement

Re: [elixir-core:10928] Re: Proposal: add :guards option to import/2

2022-06-13 Thread 'eksperimental' via elixir-lang-core
ery guard I want > > > > to import from my "Util" module. This has been a recurring > > > > issue. > > > > > > > > I think it will be a good addition given the nature of guards > > > > that since they are macros they need to be req

Re: [elixir-core:10926] Re: Proposal: add :guards option to import/2

2022-06-13 Thread 'eksperimental' via elixir-lang-core
ll the guard. > > > > What do you guys think? > > > -- 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+unsubs

[elixir-core:10924] Proposal: add :guards option to import/2

2022-06-13 Thread 'eksperimental' via elixir-lang-core
that since they are macros they need to be required, plus usually you don't want to have the module name when you call the guard. What do you guys think? -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this grou

Re: [elixir-core:10922] [Proposal] Add Tuple.replace_at

2022-06-10 Thread 'Andrey Yugai' via elixir-lang-core
Hi Rudolf. Elixir actually has such wrapper already, and what's more cool about it, it's implemented exactly how you suggested: https://github.com/elixir-lang/elixir/blob/a64d42f5d3cb6c32752af9d3312897e8cd5bb7ec/lib/elixir/lib/kernel.ex#L1724 Other tuple related functions are mentioned

Re: [elixir-core:10917] [Proposal] List.delete support for delete multiple fields inside a list

2022-06-07 Thread 'Andrey Yugai' via elixir-lang-core
ks, Randson From: 'Andrey Yugai' via elixir-lang-core Sent: 07 June 2022 16:38 To: elixir-lang-core@googlegroups.com Subject: Re: [elixir-core:10916] [Proposal] List.delete support for delete multiple fields inside a list Hey Randson, have you seen `Enum.filter`? It does almost exactly what

Re: [elixir-core:10915] [Proposal] List.delete support for delete multiple fields inside a list

2022-06-07 Thread 'Andrey Yugai' via elixir-lang-core
What I want to add is the possibility to delete multiple fields by passing a list of fields I want to remove. Can be like this one: ```elixir List.delete([:a, :b, :c, :d, :e], [:a, :b]) #=> [:c, :d, :e] ``` Or, it can be a new function to totally deal with that. like: ```elixir List.de

Re: [elixir-core:10912] [Proposal] Support for shorter @spec syntax

2022-06-03 Thread 'eksperimental' via elixir-lang-core
ine argument and response types and > automatically treat it as spec for following long_word?/1 function. > > What do you think? > > Also, in case of multiple arguments we can either wrap it in > parentheses or just use a comma for separation. > -- You received this message be

Re: [elixir-core:10909] [Proposal] Support for shorter @spec syntax

2022-06-02 Thread 'Andrey Yugai' via elixir-lang-core
I don't think there's much gain in fiddling with Elixir internals trying to modify special form, or writing new macro specifically to omit the left argument in `::/2` for function specs. Perhaps more profoundly, this would implicitly tie one spec to one function clause, which is kinda odd

[elixir-core:10887] Proposal: Add Enum.sort_by_transform/4

2022-05-04 Thread 'eksperimental' via elixir-lang-core
/elixir-lang/elixir/blob/1907914cf0d9d25b32373d3c8ad6b4b59877baaf/lib/elixir/lib/enum.ex#L3213-L3218 I see that it is already mapping after the sorting, in order to return the original values. So we are unnecessarily mapping once. What I propose is introduce Enum.sort_by_transform/4 which takes

Re: [elixir-core:10866] [Proposal] Macro.camelize support lower camel case

2022-04-11 Thread 'Andrey Yugai' via elixir-lang-core
Hey there, I think that would be a nice addition in general, but [Macro.camelize/1](https://hexdocs.pm/elixir/Macro.html#camelize/1) has a very specific purpose: > This function was designed to camelize language identifiers/tokens, that's > why it belongs to the [Macro](https://hexd

Re: [elixir-core:10841] [Proposal] Introduce `last` and `init` functions to Kernel

2022-03-24 Thread 'eksperimental' via elixir-lang-core
We already have List.last/1-2 On Thu, 24 Mar 2022 06:24:24 -0700 (PDT) Weslei Juan Novaes Pereira wrote: > As Elixir has the `hd` and `tl` functions, it'd be very useful to > have a `init` and `last` functions as well. For example: > > last: takes a list and returns its last el

Re: [elixir-core:10840] [Proposal] Add auto-formatting of alias/import/use statements to mix format

2022-03-21 Thread 'Tim Gent' via elixir-lang-core
to be accepted. A very important >> design goal of `mix format` is never to change the semantics of the code >> and changing the order of statements is changing semantics. >> >> On March 18, 2022, elixir-lang-core wrote: >> >> The Elixir style guide has guidance

[elixir-core:10837] [Proposal] Add auto-formatting of alias/import/use statements to mix format

2022-03-18 Thread 'Tim Gent' via elixir-lang-core
The Elixir style guide has guidance on how to organise module attributes, directives, and macros - https://github.com/christopheradams/elixir_style_guide#module-attribute-ordering What do people think about applying these conventions as part of mix format? Background - we have linting rules

[elixir-core:10830] Re: Authentication by image processing

2022-03-06 Thread 'Junaid Farooq' via elixir-lang-core
I think Slack is a better place for you to ask. On Monday, 7 March 2022 at 12:09:42 UTC+5 itssw...@gmail.com wrote: > I'm working on image processing in elixir. Is there any library for > implementing authentication process for images. > -- You received this message be

Re: [elixir-core:10821] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-03-02 Thread 'eksperimental' via elixir-lang-core
place equivalents. Shall we go this route for > now? Please open up an issue and feel free to submit a PR. :) > > I am not convinced on trim_prefix/trim_suffix yet though, but you can > use the replace functions to achieve the same. > > On Wed, Mar 2, 2022 at 7:11 PM 'eksperiment

Re: [elixir-core:10819] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-03-02 Thread 'eksperimental' via elixir-lang-core
to the behaviour of trim_leading/1 and trim_trailing/1). So we > could add trim_prefix/2 and trim_suffix/2, but then it is > inconsistent with other trim* functions. So unless there is a strong > reason for adding this, rather than consistency, I would not go this > route. > &

Re: [elixir-core:10817] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-03-02 Thread 'eksperimental' via elixir-lang-core
replace_leading, replace_trailing}/3 Please let me know what you think. -- 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.

Re: [elixir-core:10748] Proposal: Allow `describe` blocks in ExUnit test to be skipped

2022-02-03 Thread 'eksperimental' via elixir-lang-core
is is already possible with `@describetag :skip` inside a describe > block. There's a `@moduletag :skip` too! > > On February 3, 2022, elixir-lang-core c...@googlegroups.com> wrote: > > Currently `@tag :skip` is only effictive in tests, but if I have a > > describe block with 1

[elixir-core:10746] Proposal: Allow `describe` blocks in ExUnit test to be skipped

2022-02-03 Thread 'eksperimental' via elixir-lang-core
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...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/61fbe820.1c69

Re: [elixir-core:10729] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-01-26 Thread 'eksperimental' via elixir-lang-core
On Tue, 25 Jan 2022 18:33:08 +0100 José Valim wrote: > Yes, I think those would be consistent additions! > I will try to submit a PR this week then. -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from thi

[elixir-core:10727] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-01-25 Thread 'eksperimental' via elixir-lang-core
Hello everyone, Currently the second argument of funtions String.{trim, trim_leading, trim_trailing}/2 can only be a string. I would like Elixir to support a list of strings to be trimmed, such as: String.trim_leading(tag_name, ["OTP_", "OTP-"]) There is a preceden

[elixir-core:10706] Logger.add_backend(:console, opts) doesn't work

2022-01-18 Thread 'James Schinner' via elixir-lang-core
When I try and add the `:console` logger backend during runtime I get: ``` iex(15)> Logger.remove_backend(:console, level: :info) {:error, :not_found} ``` Looks like the `Logger.Backends.Console` is missing an init(:console, opts)` implementation? https://github.com/elixir-lang/elixir/b

Re: [elixir-core:10665] Introduce let and reduce qualifiers to for

2021-12-21 Thread 'eksperimental' via elixir-lang-core
pted only at the beginning or we will be able to call them wherever we find suitable? -- 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

Re: [elixir-core:10650] Introduce let and reduce qualifiers to for

2021-12-20 Thread 'eksperimental' via elixir-lang-core
Not necessarily that they are replaceable, but that pattern of :cont, :halt, :suspend is most commonly used via Enumerable.reduce On Mon, 20 Dec 2021 19:18:53 -0500 "'eksperimental' via elixir-lang-core" wrote: > > I have found only one usage of Enum.reduce_while in Elixi

Re: [elixir-core:10649] Introduce let and reduce qualifiers to for

2021-12-20 Thread 'eksperimental' via elixir-lang-core
reason, > data_so_far}. > > I have found only one usage of Enum.reduce_while in Elixir's codebase. > Interestingly, the shape of the return value is always the same - a > list of finished tests. > https://github.com/elixir-lang/elixir/blob/main/lib/ex_unit/lib/ex_unit/runner.ex#L340 >

Re: [elixir-core:10643] Introduce let and reduce qualifiers to for

2021-12-20 Thread 'eksperimental' via elixir-lang-core
t; Good point. I forgot to mention the :reduce option will be deprecated > in the long term. > > On Mon, Dec 20, 2021 at 7:53 PM 'eksperimental' via elixir-lang-core < > elixir-lang-core@googlegroups.com> wrote: > > > The proposal is very concise, > > the only thin

Re: [elixir-core:10641] Introduce let and reduce qualifiers to for

2021-12-20 Thread 'eksperimental' via elixir-lang-core
d proposal for-let. You can find it in a gist: > https://gist.github.com/josevalim/fe6b0bcc728539a5adf9b2821bd4a0f5 > > Please use the mailing list for comments and further discussion. > Thanks for all the feedback so far! > -- You received this message because you are subscribed to

Re: [elixir-core:10637] Proposal: Emit warning on public functions without a proper function signature

2021-12-20 Thread 'eksperimental' via elixir-lang-core
Good point, and that pretty much explains why this flag is a non-viable feature. I will make a proposal to Credo. Thank you guys for your input. On Mon, 20 Dec 2021 14:57:02 +0100 José Valim wrote: > Elixir does not have optional warnings. Or the warnings are always >

Re: [elixir-core:10635] Proposal: Emit warning on public functions without a proper function signature

2021-12-20 Thread 'eksperimental' via elixir-lang-core
ing useful for libraries, I think it is a > > very strong imposition for applications and I don’t think it should > > be the job of the compiler to enforce it. > > > > So my suggestion is to implement this as linter/credo check. > > > > On Sun, Dec 19, 2021

[elixir-core:10631] Proposal: Emit warning on public functions without a proper function signature

2021-12-19 Thread 'eksperimental' via elixir-lang-core
Hi all, Since documentation is taken seriously in Elixir, I would like to propose to emit a warning when a public function does not a have a proper/complete function signature. I describe an improper fucntion signature would look like this in your IEx/ExDoc documenation: your_function_name

Re: [elixir-core:10576] Proposal: disable doctests per doc entry

2021-12-10 Thread 'eksperimental' via elixir-lang-core
That is pretty much what I was using (it is what we use in Elixir core when an exception is raised), the issue with that is the it does not play out well with multi-line return values, which was my use case, and therefore this proposal. On Fri, 10 Dec 2021 14:42:51 +0100 Wojtek Mach wrote

Re: [elixir-core:10574] Re: Proposal: disable doctests per doc entry

2021-12-10 Thread 'eksperimental' via elixir-lang-core
rth to make sure of this. > > I would like to focus on my module and know whether I can write > > invalid doc tests or not. > > > > > > Please let me know what you thing about this, > > - Eksperimental > > > -- You received this message because y

[elixir-core:10566] Proposal: disable doctests per doc entry

2021-12-09 Thread 'eksperimental' via elixir-lang-core
"elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/61b21664.1c69fb81.f6a30.02cfSMTPIN_ADDED_MIS

Re: [elixir-core:10530] Is `@__struct__` an implementation detail or a public API?

2021-11-19 Thread 'eksperimental' via elixir-lang-core
Sorry, that was the issue. This is the actual PR https://github.com/elixir-lang/elixir/pull/10354 On Fri, 19 Nov 2021 17:09:55 -0500 "'eksperimental' via elixir-lang-core" wrote: > Hi Marten, > You will find this PR interesting > https://github.com/elixir-lang/elixir/issue

Re: [elixir-core:10529] Is `@__struct__` an implementation detail or a public API?

2021-11-19 Thread 'eksperimental' via elixir-lang-core
Hi Marten, You will find this PR interesting https://github.com/elixir-lang/elixir/issues/10352 Cheers, - Eks On Fri, 19 Nov 2021 14:00:40 -0800 (PST) "w...@resilia.nl" wrote: > Hi all! > > I recently needed to check what fields for a struct were defined (if > any) f

Re: [elixir-core:10500] Proposal: Permit specifying version requirement when declaring Mix dependencies via Git.

2021-10-25 Thread 'Frerich Raabe' via elixir-lang-core
ependency resolution > with git repos. It is going to quickly become too slow as the number of > versions and dependencies grow. > > On Sat, Oct 23, 2021 at 4:03 PM 'Frerich Raabe' via elixir-lang-core < > elixir-l...@googlegroups.com> wrote: > >> Hi all, >> >>

[elixir-core:10493] Proposal: Permit specifying version requirement when declaring Mix dependencies via Git.

2021-10-23 Thread 'Frerich Raabe' via elixir-lang-core
by the dependency resolution algorithm. Motivation == Declaring dependencies of Elixir projects via Git, e.g. by defining {:foobar, git: "https://github.com/elixir-lang/foobar.git;, tag: "0.1"} is very convenient. In many cases, dependencies are already stored in G

Re: [elixir-core:10478] Proposal: Kernel.then/3

2021-10-09 Thread 'Damir' via elixir-lang-core
", etc. Or just a plain old conditional. It > should also be trivial enough to add to your own apps if really necessary. > > On Fri, Oct 8, 2021 at 8:02 PM 'Damir' via elixir-lang-core < > elixir-l...@googlegroups.com> wrote: > >> Hi! >> >> Thanks for t

Re: [elixir-core:10476] Proposal: Kernel.then/3

2021-10-08 Thread 'Damir' via elixir-lang-core
ty) > |> apply_sales_tax(state). # apply_sales_tax would know whether or not to > do anything based on the state > > You say you have to do this "often" -- can you give us some real-world > examples of your code logic that you feel necessitates this kind of thing? > I really

[elixir-core:10473] Proposal: Kernel.then/3

2021-10-08 Thread 'Damir' via elixir-lang-core
s anymore, improving composability. Example usage: y_needed = # true or false some_value |> do_something() |> then(y_needed, _y(&1, arg0, arg1) ) -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from t

[elixir-core:10270] Feature request: compiler warning when you've created a compile-time cycle

2021-05-22 Thread alex via elixir-lang-core
I've spent 5 days untangling module deps in a huge Elixir codebase. I'm almost done, but I wish this problem didn't happen in the first place. I want the compiler to SCREAM at me if I've introduced a compile-time cyclic dependency. In the short term, my plan is to add a stage to the CI, which

Re: [elixir-core:10115] [Proposal] Map.filter/2 based on :maps.filter

2021-03-11 Thread 'Keith Salisbury' via elixir-lang-core
lt;https://www2.elixirconf.eu/elixir-conf-2021/es> 8-10 September 2021 Code Beam SF: <https://www2.codesync.global/code-beam-sf-2021/es> 4-5 November 2021 Erlang Solutions cares about your data and privacy; please find all details about the basis for communicating with you and the

Re: [elixir-core:10096] [Proposal] Add JSON structured logging backend to Logger

2021-02-25 Thread 'Ulisses Almeida' via elixir-lang-core
I felt that in my skin on my previous work. We had many different Elixir apps, each one used a different library, each library was missing some feature or had some bug, each library was forked to fill the missing gap, every fork wasn't great. Em quarta-feira, 9 de dezembro de 2020 às 18:13:25

Re: [elixir-core:9931] Proposal `Enum.more_than?/2` or `List.more_than?/2`

2021-01-11 Thread 'Jayson Vantuyl' via elixir-lang-core
change change the name if we land on > something better: https://github.com/elixir-lang/elixir/pull/10532/files > > I personally still prefer `count_until`. > > On Friday, December 4, 2020 at 11:24:06 AM UTC-5 ad...@a-corp.co.uk wrote: > >> What about count_upto or count

Re: [elixir-core:9809] Proposal `Enum.more_than?/2` or `List.more_than?/2`

2020-12-03 Thread 'Jayson Vantuyl' via elixir-lang-core
t?/2 >>> > > >>> > > On Thu, Dec 3, 2020 at 5:14 PM Michał Muskała >>> > > wrote: >>> > > >>> > >> Unfortunately this can’t be done automatically since it has subtle >>> > >> semantic difference

Re: [elixir-core:9777] Inspect Redaction / Override

2020-11-09 Thread 'Jayson Vantuyl' via elixir-lang-core
ing on > `persistent_term` already on OTP 21.0+ would be to provide a non-NIF > fallback implementation. > After all, `persistent_term is based on userspace-libraries written in > Elixir and Erlang that were released before (c.f. the FastGlobal Elixir > library on Hex and mochiglobal >

Re: [elixir-core:9770] Inspect Redaction / Override

2020-11-06 Thread 'Jayson Vantuyl' via elixir-lang-core
That would help with Ecto. Unfortunately we still see a bunch of stuff from the likes of Elixir GRPC and various structs from libraries that don't have that kind of functionality. We were kind of hoping for a top-down, whitelist approach. We figure that it's easier to plug the leak from

[elixir-core:9768] Inspect Redaction / Override

2020-11-06 Thread 'Jayson Vantuyl' via elixir-lang-core
brary does it, then you need Override2 or 3 or 4... - *Con:* Probably gets redundant if there ever is a blessed way to override protocols. - *Con:* I already pitched this to a few Elixir celebrities and they thought it was a bit too hacky. *In Closing* So, yeah, in the long term, m

  1   2   >