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://hexdocs.pm/elixi
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 if you
Hey Randson, have you seen `Enum.filter`? It does almost exactly what you want,
except for any enumerable, not just list.
Original Message
On 7 Jun 2022, 18:31, Randson < orand...@gmail.com> wrote:
Currently, the function `List.delete` only works for a single field. What I
wa
Thanks,
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 e
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 at the top
I think negated `Enum.any?` should be equal to `Enum.none?` in all cases. Also
do you have an example where `Enum.none?` would be useful?
Original Message
On 18 Jun 2022, 17:35, Zvonimir Rudinski wrote:
> Seeing Enum.all?/2 being available made me assume there was also an
> En
For this behavior I think you'd be better of using `map[key] || default_value`,
or even `Map.get(map, key) || default_value`. Docs for `Map.get/3` are pretty
clear about when it returns default value.
Original Message
On 22 Jun 2022, 14:25, Nganga Mburu wrote:
> I've found mys
being handled 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
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 repo
I think larger units were added since 1.14, but if you cannot upgrade for some
reason, Timex has a nice API: `Timex.shift(dt, months: 1, days: 4.5, minutes:
-30, seconds: 50)`
Sent from Proton Mail mobile
Original Message
On 12 Dec 2022, 20:21, Daniel Kukuła wrote:
> Hi - thi
There's also an option of pattern matching any struct, not exactly a guard, but
changing your code a bit shouldn't be a problem
```
def foo(%_{} = _struct), do...
def foo(map) when is_map(map), do...
```
Sent from Proton Mail mobile
Original Message
On 4 Jan 2023, 04:03, Ja
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
Whether any function is worth of stdlib is a really subtle topic, but I think
it'd be helpful to try to consider why average function hasn't been added yet.
>From my experience, the order on any kind of elements comes up pretty often,
>thus min/max values are widely used. In the same vein sum al
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
> ```
>
> maybe rewr
I haven't checked in a while, but there aren't many issues to begin with, and
they require quite a bit of context to just start digging. Some are for
tracking purposes and you shouldn't submit any PR's for them
Original Message
On 20 Sept 2023, 16:17, Apoorv Gupta wrote:
> Eli
In my career I've never been in position to run `git init`, and now you want to
make it completely impossible :)
Original Message
On 26 Dec 2023, 19:53, Jean Lima wrote:
> Add git support to mix new as argument.
>
> With the intention of a better experience for users starting a
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 no
17 matches
Mail list logo