TIL: I knew about Enum.into but not Map.new.
On Sat, Jul 25, 2020 at 3:08 AM José Valim wrote:
> Hi Sabiwara,
>
> This is very close to Map.new/2 (and Enum.into/3):
>
> User |> Repo.all() |> Map.new(fn user -> {user.id, user} end)
>
> So my suggestion is to use Map.new/2 instead of adding a new
I agree on the name feeling subpar :) I’ll take a look and see if I can
find other examples.
On Thu, Dec 3, 2020 at 12:21 PM José Valim wrote:
> Thanks Zach! I like this idea but the proposed name, for some reason,
> doesn't sit right with me. Is there any prior art from other langs we could
> l
Nothing is jumping out at me from elsewhere yet, but another option might
be accepting options in `Enum.count`, like `Enum.count(list, max: 4)`.
I’ll keep searching though.
On Thu, Dec 3, 2020 at 1:31 PM Zach Daniel
wrote:
> I agree on the name feeling subpar :) I’ll take a look and see i
Another benefit to the options list would be supporting it for count with a
predicate, e.g Enum.count(enum, &some_predicate/1, max: 4)
On Thu, Dec 3, 2020 at 1:35 PM Zach Daniel
wrote:
> Nothing is jumping out at me from elsewhere yet, but another option might
> be accepting
be
expected to enumerate them, so maybe only something like List.count 🤷♂️
On Thu, Dec 3, 2020 at 1:42 PM Zach Daniel
wrote:
> Another benefit to the options list would be supporting it for count with
> a predicate, e.g Enum.count(enum, &some_predicate/1, max: 4)
>
> On Thu, Dec
mpiler? Probably wouldn’t be good for all Enums, since counting would be
> expected to enumerate them, so maybe only something like List.count 🤷♂️
>
>
>
> On Thu, Dec 3, 2020 at 1:42 PM Zach Daniel
> wrote:
>
> Another benefit to the options list would be supporting it
t would require at least two
> function calls.
>
> >
> > Allen Madsen
> > http://www.allenmadsen.com
> >
> >
> > On Thu, Dec 3, 2020 at 6:51 PM Zach Daniel
> > wrote:
> >
> > > Well, List.count doesn’t exist yet, but either way it sounds like
> >
ed the number? After all, if I
>>> am interested in knowing if something has less than 10, 10, or more than
>>> 10, I just need to count until eleven. Returning a number seems to be more
>>> flexible too. Therefore, what do you think about: count_until(enum, va
I commonly need to flip the keys/values when using Map.new, why not add an
option to Map.new? I don’t like this name, but this reads pretty nicely to
me
list
|> Enum.with_index()
|> Map.new(flip: true)
On Tue, Dec 8, 2020 at 4:35 PM Austin Ziegler wrote:
> I’m not opposed to the idea, but would
I like that idea a lot Bruce. Let’s you do something like:
maps |> Enum.with_index(&Map.put(&1, :index, &2))
On Tue, Dec 8, 2020 at 4:50 PM Bruce Tate wrote:
> Maybe a transform function on with_index?
>
> Enum.with_index([:a, :b, :c], &{&2, &1})
>
> -bt
>
> On Tue, Dec 8, 2020 at 3:05 PM José
There are theoretical name conflicts from not being able to say “only
import this story” (e.g if you have a function with the same name but one
less argument) what about import Mod, only: [func: 1..3]?
On Fri, Dec 25, 2020 at 5:36 PM thojan...@gmail.com
wrote:
> Say function `foo` has multiple
Sorry, meant to say “in being able to say only import this *function*”, not
story :)
On Fri, Dec 25, 2020 at 5:42 PM Zach Daniel
wrote:
> There are theoretical name conflicts from not being able to say “only
> import this story” (e.g if you have a function with the same name but one
:03 PM UTC+1 zachary@gmail.com
>> wrote:
>>
>>> Sorry, meant to say “in being able to say only import this *function*”,
>>> not story :)
>>>
>>> On Fri, Dec 25, 2020 at 5:42 PM Zach Daniel
>>> wrote:
>>>
>>>> There are
Yeah, this is a great idea. I would love this :) I also agree that it would
better to do it with an option though.
On Mon, Dec 28, 2020 at 3:01 PM Felipe Stival wrote:
> I'm 100% in for this as a `:with` or `:apply` option for IO.inspect/2. I
> believe adding it as a new function may add unneces
roduce a
> general approach to this, such that:
>
> |> tap(&IO.inspect(Map.keys(&1))
>
> But we always got stuck on what to call said function.
>
> On Mon, Dec 28, 2020 at 21:07 Zach Daniel
> wrote:
>
>> Yeah, this is a great idea. I would love this :) I
That takes it a bit too far for my taste. That part can easily be done by
passing an anonymous function and calling a series of functions.
On Mon, Dec 28, 2020 at 9:55 PM Kevin Johnson
wrote:
> I would prefer to introduce a general approach to this, such that:
>
> How general do you want it to
That variant doesn’t really work because what if you want to pass a
function as the first argument to what you’re calling? I don’t think
muddying the behavior of “apply” is worth the extra confusion. I think
either `tap/2` or a `with` Inspect option is the way. People will
ultimately need to look t
nd])
> #Function<21.126501267/0 in :erl_eval.expr/5>
> iex(2)> apply(& &1, 3)
> ** (ArgumentError) argument error
> :erlang.length(3)
> iex(2)> apply(& &1, [3])
> 3
> iex(3)> apply(& &1, [])
> ** (BadArityError) #Function<7.126501267
What would be really awesome is some kind of "rubric" for answering the
question "does this belong in the standard library". It could be as simple
as something like a set of criteria like "ubiquity", "utility", "new value
add", and some scores that it needs to exceed, e.g perhaps greater than a
7/1
I like the new operator concept as well. The semantics of it could be
extended to `with`,
E.g
with {:ok, res} <- thing(),
{:ok, handled} <<- handle_res(thing),
…
On Fri, Jun 11, 2021 at 2:11 PM Paul Schoenfelder <
paulschoenfel...@fastmail.com> wrote:
> In my opinion, internal c
Ultimately if we don’t prefer the operator, I’d rather just see:
for var <- list do
%{destructured: data} = var
end
Over the `for!` operator. I don’t know why the operator seems so much better
than `for!` to me though.
> On Jun 15, 2021, at 1:45 PM, Stefan Chrobot wrote:
>
> Ideally, <- and
This question may be tangentially related, but I'll bring it up here:
It seems that, even if it is just the last module that has to compile that
fails, nothing is cached/saved, and on subsequent compilations, the entire
application will need to be recompiled. I'm unsure if there are technical
li
l.erl:685: :erl_eval.do_apply/6
>>
>> Then I fixed it:
>>
>> ~/ML/livebook[jv-eval-compile *]$ mix test
>> Compiling 1 file (.ex)
>>
>> ......
Fwiw, “slide” sounds like a much more intuitive name than rotate, to me.
Rotate sounds like a 2d matrix operation (often commonly done on lists).
Additionally, we should probably support a range *or* an index as the
second argument, since moving one thing is still useful, and would be a
good f
Just want to chime in and say that I somehow missed the addition of `Map.map`,
`Map.filter` and `Map.reject` and I am *thrilled* by those additions :D
Sent via Superhuman ( https://sprh.mn/?vip=zachary.s.dan...@gmail.com )
On Sun, Nov 07, 2021 at 3:19 PM, Tyler Young < s3c...@gmail.com > wrote:
For some reason, this seems off to me. It seems to me like something like a.)
allowing enumerable implementors to override the method of splitting, and then
b.) allowing `split_with` to specify an option that says "I expect the original
type back", might be better? My perspective here is based o
I may not fully be understanding what we're looking for here, but it seems like
this would effectively be the equivalent of:
```
result =
for foo ← [1, 2, 3], reduce: %{acc: [], counter: 0} do
%{acc: acc, counter: counter} ->
new_acc = some_calc(acc)
%{acc: new_acc, counter: counter + 1}
end
act
n Fri, Dec 17, 2021 at 12:59 PM, Zach Daniel < zachary.s.dan...@gmail.com >
wrote:
>
> I may not fully be understanding what we're looking for here, but it seems
> like this would effectively be the equivalent of:
>
>
>
> ```
> result =
> for foo ← [1, 2, 3]
ee
> that you will need to accumulate elements, add Enum.reverse/1, etc. All
> which will make the solution noisier.
>
> On Fri, Dec 17, 2021 at 6:59 PM Zach Daniel < zachary. s. daniel@ gmail. com
> ( zachary.s.dan...@gmail.com ) > wrote:
>
>
>> I ma
hat the
> fact the accumulator is matched in a clause inside do-end is a specific
> behavior to for that we partly accept because we got used to it!
>
> On Fri, Dec 17, 2021 at 19:19 Zach Daniel < zachary. s. daniel@ gmail. com
> ( zachary.s.dan...@gmail.com ) > wrote:
>
>
I really like this, and would be happy with it as is 😁 I have one thought
though, with the way that we are already doing a bit of “magic” (I don’t mean
that in a negative way) to map the “let” variable to the second element of the
tuple, could we support multiple assignments without the tuple in
for let x = 10, let y = 12, foo <- list do
{result, x, y}
end
Sent via Superhuman iOS ( https://sprh.mn/?vip=zachary.s.dan...@gmail.com )
On Tue, Dec 21 2021 at 4:35 PM, Zach Daniel < zachary.s.dan...@gmail.com >
wrote:
>
> I really like this, and would be happy with it as i
>
> I also considered this and I think the "multiple lets" and "multiple
> reduces" could get confusing. Can I have both? Can I declare them
> anywhere? The answer is no. Given you can't combine them and only use them
> at the beginning, it feels like having only one is the more appropriate
> choi
I've tried setting the extensions list to `[".ex", ".exs"]`, but it looks
like it isn't possible to write a custom formatter that would run on elixir
files. The use case (something that Ash users are currently asking for) is
a way to enforce consistency in their usage of the DSL using a formatte
oh, excellent! Thanks!
On Wednesday, February 2, 2022 at 10:46:52 AM UTC-5 José Valim wrote:
> We have added support for overwriting the formatter for .ex and .exs in
> the v1.13 branch. It may have been released on v1.13.2 already.
>
> On Wed, Feb 2, 2022 at 4:40 PM Zach D
This is something coming from a compile time optimization that Ash
Framework does.
In an Ash resource there is something called a change its basically like a
plug but it operates on an Ash.Changeset
So you might see something like this:
```
# in the resource
actions do
create :create_with_
Also, I forgot to mention, it was @icecreamcohen on discord who had the
idea that redefining alias may work (although they didn't really condone
it), don't want to take credit for anyone elses ideas though.
On Monday, May 9, 2022 at 1:53:50 PM UTC-4 Zach Daniel wrote:
> This is som
nly be used if you indeed don't use it at
> compile time.
>
> On Mon, May 9, 2022 at 7:56 PM Zach Daniel wrote:
>
>> Also, I forgot to mention, it was @icecreamcohen on discord who had the
>> idea that redefining alias may work (although they didn't really condo
é Valim wrote:
>>
>>
>>> Btw, we will also have a public API on Elixir v1.14 for expanding
>>> literals, so the problem shall disappear altogether. However, you must be
>>> extremely careful: this should only be used if you indeed don't use it at
>>> com
You wouldn't be able to pattern match on the input being a list regardless
because you could have a list of lists and be wanting to delete one of those
lists.
For example:
```elixir
List.delete([[:a, :b], [:c, :d]], [:a, :b])
#=> [[:c, :d]]
```
And I generally agree with others that the Enum
The `--` operator has an important difference in behavior from
Enum.filter/reject, though.
[:a, :a, :a] -- [:a]
[:a, :a]
On Tue, Jun 07, 2022 at 1:30 PM, Wojtek Mach < woj...@wojtekmach.pl > wrote:
>
> The --/2 operator already does this. :)
>
>
> iex(1)> [:a, :b, :c, :d, :e] -- [:a, :b]
>
I think there is a really important function of a standard library for things
like this. This conversation has effectively generated knowledge, specifically
that the best way to implement `Enum.none?/2` is simply by negating
`Enum.any?/2`. And while it is very easy for anyone to add this code to
:26:57 -0700
>>>> Kurtis Rainbolt-Greene wrote:
>>>>
>>>> > While quippy `!Enum.any?` also just doesn't work in some cases:
>>>> >
>>>> > ```
>>>> > iex(2)> ["a","b","c"] |> !Enu
currently doing things. The
primary issue here is that the things using `expand_alias_no_require/2`
currently are marked as unused alias, and from what I can tell
`expand_literal/2` doesn't solve for that issue.
On Monday, May 9, 2022 at 4:33:58 PM UTC-4 Zach Daniel wrote:
> Awesome, thanks!
g), do: 10
end
```
On Mon, Jul 11, 2022 at 1:42 PM, José Valim < jose.va...@dashbit.co > wrote:
>
> In this case you pass lexical_tracker: nil indeed, that's what we do for
> defimpl for now, although it is a private API for now.
>
>
> On Mon, Jul 11, 2022 at 7
alias Baz` warning.
On Mon, Jul 11, 2022 at 1:48 PM, Zach Daniel < zachary.s.dan...@gmail.com >
wrote:
>
> Interesting…I'll do some spelunking and try to figure out why `defimpl`
> doesn't yield the same unused alias warnings that my code does then
>
>
>
>
37 PM José Valim < jose. valim@ dashbit. co (
> jose.va...@dashbit.co ) > wrote:
>
>
>> I see. Great find. Back to the drawing board.
>>
>>
>> On Mon, Jul 11, 2022 at 8:34 PM Zach Daniel < zachary. s. daniel@ gmail. com
>> ( zachary.s.dan...@gmail
An interesting question that should be defined that highlights the main
difference between MapSet and List: what is the result of
`List.includes_sublist?([1, 2, 3], [1, 1, 1])`? If the answer is `true` then I
think the function should still be called `List.subset` because that is what
its reall
ntained? and none_contained?
>
>
> I think all_contained? is not clear about the strict order of the
> elements...
>
>
>
> Probably think on the function name is hardest than the logic behind... :)
>
>
>
>
>
> El vie, 15 jul 2022 a las 11:21,
In Ash Framework, we have declarative ways to construct runtime behavior
using behaviors. So an Ash resource might look like this:
```elixir
defmodule MyApp.User do
use Ash.Resource
alias MyApp.User.Changes.HashPassword
attributes do
uuid_primary_key :id
end
actions do
For clarity, the dependency I'm talking about there is the dependency from
`MyApp.User` to `MyApp.User.Changes.HashPassword`.
On Sunday, September 11, 2022 at 1:55:51 PM UTC-4 Zach Daniel wrote:
> In Ash Framework, we have declarative ways to construct runtime behavior
> using behav
er 11, 2022 at 2:31:42 PM UTC-4 José Valim wrote:
> Sorry, I don't understand the proposal. You mentioned expand_literal,
> which already removes the compile-time dependency but keeps the remaining
> functionality such as warnings. Can you please expand?
>
> On Sun, Sep 11, 20
module
>> at runtime, you must not remove the compile time dependency.
>>
>>
>> On Sun, Sep 11, 2022 at 8:52 PM Zach Daniel < zachary. s. daniel@ gmail. com
>> ( zachary.s.dan...@gmail.com ) > wrote:
>>
>>
>>> `expand_literal` re
ncies
> when they are explicitly listed in the code as above. When done via
> configuration, at least you are not literally listing it.
>
> On Sun, Sep 11, 2022 at 8:59 PM Zach Daniel wrote:
>
>> So all we we do is hold onto the module, and then at runtime we go
>> through t
like what Ash
provides?
On Sun, Sep 11, 2022 at 3:08 PM, Zach Daniel < zachary.s.dan...@gmail.com >
wrote:
>
> Hm...yeah, that makes sense. Are there other things a runtime dependency
> is meant to do aside from ensure that transitive compile time dependencies
> are properly
ose.va...@dashbit.co > wrote:
>
> As I mentioned, the issue on transitive compile-time dependencies are the
> compile-time deps, not the runtime ones. So I would focus on how to
> eliminate those. Otherwise I am not sure we will agree on the problem
> statement. :)
>
>
> On
configuration in a module attribute. Users are aware that you
>>>>> can't call these pluggable modules at compile time. Only the framework
>>>>> code calls those modules. The above example is contrived, of course, I'm
>>>>> not suggesting that we need a feature to make *that* work, j
What if a syntax for matching on keyword lists that allowed for items in any
position was added to Elixir? Something like (just shooting from the hip)
`[…foo: bar]` ? Then you could have your cake and eat it too, right?
On Thu, Oct 27 2022 at 5:25 PM, Brandon Gillespie < bran...@cold.org > wrote
Myself and many other developers have been bitten by the fact that maps are
sorted if they have less than 33 elements. Not because we believed that we
should rely on the sort ordering of a map, but because we *accidentally*
wrote an implementation that did, and didn't test it with more than 32
p with said assumptions.
>
> On Fri, Oct 28, 2022 at 06:20 Zach Daniel < zachary. s. daniel@ gmail. com
> ( zachary.s.dan...@gmail.com ) > wrote:
>
>
>> Myself and many other developers have been bitten by the fact that maps
>> are sorted if they have less than 3
t;
>>
>>
>> On Fri, Oct 28, 2022 at 12:34 AM, José Valim < jose. valim@ dashbit. co (
>> jose.va...@dashbit.co ) > wrote:
>>
>>> Can you please provide the documentation for said environment variable
>>> from Erlang?
>>>
>>>
>
Couldn’t anyone who wants to do something like this just use a tool like
nimble_options (at least in the near to mid term)? That’s what I do.
https://github.com/dashbitco/nimble_options
On Fri, Oct 28 2022 at 12:35 PM, Wiebe-Marten Wijnja < w...@resilia.nl > wrote:
>
>
>
> Thank you for star
simple key/value data structure which gets accessed through
> direct work with a key or pattern matched against
>
>
>> On 28 Oct 2022, at 06:20, Zach Daniel < zachary. s. daniel@ gmail. com (
>> zachary.s.dan...@gmail.com ) > wrote:
>>
>>
>
>
>
&g
on to a list you expect is unclear given that strings
> sorted differently than numbers ( "9" > "100" => true ).
>
>
>> On 30 Oct 2022, at 00:27, Zach Daniel < zachary. s. daniel@ gmail. com (
>> zachary.s.dan...@gmail.com ) > wrote:
>>
>&
It would be great to come up with some kind of heuristic and/or consistent
philosophy on what belongs in the standard library, to guide these discussions.
Some kind of rubric could make these kinds of conversations easier or even
prevent them entirely. For me, the main guiding principles are whe
ne of the concerns I raised in the original PR and your solution is quite
> elegant.
>
>
> Which also brings another point: if the implementation is 6 LOC (I believe
> the first two clauses are not strictly necessary), then there is even less
> reason to add it to Elixir.
>
velopment.html )
>
>
> However we can give more leeway to functions compared to features.
>
>
> On Sun, Nov 20, 2022 at 16:25 Zach Daniel < zachary. s. daniel@ gmail. com
> ( zachary.s.dan...@gmail.com ) > wrote:
>
>
>> This is the kind of thing I mean w
cy requires normalization of each string. The
>>> solution is very non-obvious, and many wouldn't even think to seek out
>>> something better than string1 == string2. So that would pass #2 and #3 on
>>> the rubric.
>>>
>>> Just some ideas.
>>&
Maybe a ridiculous idea, but could we support the actual core pattern matching
syntax in some way to support this kind of thing? If so, it could make pattern
matching even more powerful than it already is.
This is *not* a good suggestion for the syntax I think its very very ugly and
not good, I
Wouldn't this suffice?
```
defguard is_real_map(x) when is_map(x) and not is_struct(x)
```
On Tue, Jan 03, 2023 at 11:34 PM, Andrey Yugai < andr...@pm.me > wrote:
>
> There's also an option of pattern matching any struct, not exactly a
> guard, but changing your code a bit shouldn't be a prob
My library git_ops https://github.com/zachdaniel/git_ops is a native elixir
solution for managing a change log with tags for releases. Im sure it could be
improved, but it’s a solid foundation that a lot of people are using today.
Plus, the conventional commit format is a well known already spec
Forgot the most relevant point: it can automatically include the generated
release notes in the git tag that is generated which translates to release
notes when pushed.
On Fri, Jan 13 2023 at 9:31 AM, Zach Daniel < zachary.s.dan...@gmail.com >
wrote:
>
> My library git_ops https:
m
> wrote:
>
>
>> Forgot the most relevant point: it can automatically include the generated
>> release notes in the git tag that is generated which translates to release
>> notes when pushed.
>>
>>
>>
>>
>> On Fri, Jan 13 2023 at 9:31 AM
> conventional commits and I hate writing commits there, because the title
> should be short but meaningful, and that’s hard in 52 characters.
>
>
> -a
> (Sorry. I’ve not really had a place to rant about this because I stopped
> blogging years ago, I’ve given up on Twitter
Yes please :) that’s is all.
On Sat, Mar 4 2023 at 3:15 AM, José Valim < jose.va...@dashbit.co > wrote:
>
> Sigils in Elixir are currently limited to a single letter. We had many
> discussions in the past about allowing more letters but they were
> ultimately rejected because of lowercase sigils
This does actually strike a chord for me and I'm realizing this is likely a
related question or perhaps the same question in another form. Is there some
way to define a module that a dependency can use at compile time or at runtime
without these warnings? Like a module that you want compiled bef
You could consider using Spark :)
https://github.com/ash-project/spark
Its used for Ash Framework, as well as ChannelHandler:
https://felt.com/blog/pheonix-channel-routing-patterns
On Sat, Apr 29, 2023 at 12:00 PM Brandon Gillespie wrote:
> I realize CLI tooling isn't elixir's focus, but what
I'd amend the proposal:
To make a dependency only present when a feature is used
```elixir
{:optional_dep, …, optional: [:feature1, :feature2]}
```
To use a dependency with features
```elixir
{:dep, …, features: [:feature1]}
```
And then build features into `Mix` (which is available at com
Yes, if you want something with maximal flexibility you’d use application
config and regular optional dependencies. The idea is to find a middle ground.
Because we cannot run arbitrary code every time we want to solve versions. A
package published to hex must know *all* potential dependencies.
But also I think we should remove the `module` part from the proposed behavior.
That’s the point I’m making, it’s not flexible as you’ve pointed out. But the
features-> deps part must be static and simple.
On Tue, May 16 2023 at 6:52 AM, Zach Daniel < zachary.s.dan...@gmail.com &g
Agreed.
On Tue, May 16 2023 at 8:06 AM, Bruce Tate < br...@grox.io > wrote:
>
> It's only an incremental move in the right direction, but a good one. I am
> strongly in favor of this proposal.
>
>
> -bt
>
> On Tue, May 16, 2023 at 3:59 AM Wojtek Mach < woj...@wojtekmach.pl > wrote:
>
>
>
>
I think the proposed syntax adds value and should be implemented as part of
the core Elixir syntax. I also think it should not be considered for string
keys, only for atom keys.
Here is a really contrived example:
`%Struct{some_xy1_stup4d_8345324_name: some_xy1_stup4d_8354324_name} = value`
`
The point wasn't about not typing long names :) Or about remapping. It was
about knowing when I have to know that the keys and corresponding variable
names were different, and when I don't.
Ultimately I think this either lives in core or nowhere else, and that if
people on a given project didn'
I agree with Paul on the specific operator, however I feel like you've just
done a great thing laying out most if not all of the considerations we've had
on this conversation to date. I know that these conversations can get long and
sometimes not produce fruit, but I feel like we should try to c
Perhaps removing the `:` is a bad idea actually? I see now it removes the
consistency on values. Either way, let's not lose the momentum on this! I feel
like we can get this over the line (or put the last nails in its coffin for
good )
On Wed, Jun 28, 2023 at 8:45 PM, Zach D
Right now if you use access on a list, it expects it to be a keyword and
requires the value to be an atom.
I've tried to think of a reason why we couldn't support this in the
language, but I haven't been able to. If the value being accessed is an
`integer` it could get the item at that index, a
Languages that support it via square brackets: Rust, Ruby, Javascript, Python,
C, Julia.
I see your point, ultimately for me what is frustrating is when I have
predefined data structures and we have a tool for "get the value at some point
(i.e map keys)" so I can do `map[:key][:key]` but if I w
I mean ` Enum.at/2` ( http://enum.at/2` ) 😆
On Thu, Sep 21, 2023 at 1:14 PM, Zach Daniel < zachary.s.dan...@gmail.com >
wrote:
>
> Languages that support it via square brackets: Rust, Ruby, Javascript,
> Python, C, Julia.
>
>
> I see your point, ultimately for me wha
if we're doing it to help people write
idiomatic code (which will probably be mostly beginners), we should point them
more clearly to this then IMO.
On Thu, Sep 21, 2023 at 1:25 PM, Zach Daniel < zachary.s.dan...@gmail.com >
wrote:
>
> I mean ` Enum. at/ 2` ( http:
Yeah, I'm familiar with the differences on that front, but at the end of the
day there are plenty of times where its perfectly normal to get a list/tuple
element by index. It seems like a natural syntax extension to me (the syntax is
basically already there, just intentionally blocked off in a w
Nice 😆. That is a definite improvement. Ultimately, I think it would be a nice
improvement to the language, but I don't disagree with the idea that we need to
take great care for the on ramp and to help people avoid footguns. I don't
think its very likely that I'll convince the team to add it, a
Hey all! This isn't a fully fleshed out idea, but something that I've
noticed especially with Ash Framework is how a *large* portion of our code
should only ever be called when compiling.
What brought this to my attention recently is that there are tons of places
where we may do things like con
e/achieve this is by having a separate package that you won't
> include in releases. It will be available for compilation, but not
> runtime.
>
>
> On Thu, Feb 1, 2024 at 7:16 PM Zach Daniel < zachary. s. daniel@ gmail. com
> ( zachary.s.dan...@gmail.com ) > wrote:
That's aside from the "I don't want users to call this because it unsafely
creates atoms", which isn't actually a problem I currently have now, as its
usually pretty obvious what code is for compile time use and what isn't.
On Mon, Feb 05, 2024 at 1:10 P
Hey all!
Something that happens very often to Ash users is forgetting to do
something like `require Ash.Query`, and then doing something like this:
```
Ash.Query.filter(Resource, name == "fred")
```
Then, they get an error like `error: undefined variable "name"`
What I'm wondering is if we can
his is a macro and warn,
> but now we are allowing a program that we are certain to fail, to compile and
> move forward.
>
> Maybe there are other solutions but I can't think of anything else :(
>
> On Tue, Apr 2, 2024 at 8:40 PM Zach Daniel <mailto:zachary.s.dan...@g
t. Please open up an issue so we don't forget about it. :)
>
> On Tue, Apr 2, 2024 at 11:36 PM Zach Daniel <mailto:zachary.s.dan...@gmail.com>> wrote:
>> Could we potentially do something only in the case that we reach this error?
>> Like if a module fails to com
We've also had a fair amount of difficulty here, in a similar vein (but
slightly different).
Specifically, we need to modify the `mix.exs` file to include a new
dependency and do a recompile. I can understand that
`Mix.Task.run("compile")` should remain as it is, but it would be great if
there
Hey folks!
In igniter, a core concept we have is `mix igniter.install dep`, which
patches the `mix.exs` file, recompiles the app accordingly, and then looks
for a mix task called `mix .install`, and invokes it. There are lots
of other features, but this is the crux of it.
In an ideal world, I
, it would be
> fine.
>
> On Tue, Jul 30, 2024 at 21:05 Zach Daniel <mailto:zachary.s.dan...@gmail.com>> wrote:
>> Hey folks!
>>
>> In igniter, a core concept we have is `mix igniter.install dep`, which
>> patches the `mix.exs` file, recompiles the app
1 - 100 of 121 matches
Mail list logo