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

2024-05-07 Thread Allen Madsen
This also has similar syntax to the erlang version: https://www.erlang.org/doc/reference_manual/expressions#receive Allen Madsen http://www.allenmadsen.com On Tue, May 7, 2024 at 7:48 AM Jon Rowe wrote: > To put across an alternative viewpoint, the way it is now reads > consis

Re: [elixir-core:11335] Would Keyword.merge_all/1 be a good idea?

2023-04-04 Thread Allen Madsen
One option that already exists: [ config, config_host, config_user, config_port ] |> Enum.reduce(/2) Allen Madsen http://www.allenmadsen.com On Tue, Apr 4, 2023 at 4:53 PM Austin Ziegler wrote: > I recently found myself wanting a variadic version of `Keyword.merge/2` >

Re: [elixir-core:11110] Partially applied pipelines/currying/etc

2022-10-26 Thread Allen Madsen
ept(conn, "html"), {:ok, conn} <- fetch_session(conn), ... do #... else {:halt, conn} -> #... end Allen Madsen http://www.allenmadsen.com On Wed, Oct 26, 2022 at 11:49 AM pragdave wrote: > > > On Tuesday, October 25, 2022 at 9:56:14 PM UTC-5 dorga...@gmail.c

Re: [elixir-core:10876] [Proposal] Add a customizable function for the struct update syntax (%Struct{my_struct | some: a, fields: b})

2022-04-25 Thread Allen Madsen
if this is different then the map update syntax, but I feel like it was last time I checked. How does that fit into your proposal? Allen Madsen http://www.allenmadsen.com On Mon, Apr 25, 2022 at 10:31 AM w...@resilia.nl wrote: > Structs are implemented as maps. > However, throughout more recent

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

2021-10-08 Thread Allen Madsen
No opinion on whether this function exists or not. But, if it did, I think the second argument should be a function, so that conditionality can depend on a property of the first argument. Allen Madsen http://www.allenmadsen.com On Fri, Oct 8, 2021 at 6:59 AM 'Damir' via elixir-lang-core

Re: [elixir-core:10468] Add ability to use 'original' mix task

2021-09-30 Thread Allen Madsen
I assume you're referring to the test alias that phoenix generates for you. If so, you can create another alias that calls just tests. defp aliases do [ test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], "just.test":

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

2021-09-10 Thread Allen Madsen
Perhaps also benchmark the combination of Enum.filter/2 and Enum.into/2, since this is the current way with the elixir standard library. Allen Madsen http://www.allenmadsen.com On Fri, Sep 10, 2021 at 1:21 PM Wiebe-Marten Wijnja wrote: > I've done some benchmarking > > > Imp

Re: [elixir-core:10339] [Question] Why does elixir not check source content to detect modifications?

2021-06-21 Thread Allen Madsen
+1 I've noticed mtime changes in some scenarios related to CI and docker, that causes things to be recompiled again even though there's no other change to the files. Allen Madsen http://www.allenmadsen.com On Mon, Jun 21, 2021 at 3:29 AM Marc-André Lafortune < marc-an...@marc-andre.ca>

Re: [elixir-core:10330] [Proposal] Strict matching comprehensions

2021-06-16 Thread Allen Madsen
ruct over the other things presented so far. Allen Madsen http://www.allenmadsen.com On Tue, Jun 15, 2021 at 7:51 PM Christopher Keele wrote: > *Re: Allen Madsen* > > It's curious that for supports the match clause *{key, value} = option* > works but *option = {key, value} *does not. &g

Re: [elixir-core:10265] [Proposal] Add a Float.nearly_equal? function.

2021-05-20 Thread Allen Madsen
Python has a pretty nice PEP for this https://www.python.org/dev/peps/pep-0485/ Allen Madsen http://www.allenmadsen.com On Thu, May 20, 2021 at 3:31 AM José Valim wrote: > Thanks Eamonn for sharing! The article and its references led to very > interesting reading. > > In principle

Re: [elixir-core:10197] Proposal: Warn on duplicated specs

2021-04-05 Thread Allen Madsen
I believe the way dialyzer works, you can write two specs and it's valid. For example: @spec foo(1) :: "one" @spec foo(2) :: "two" def foo(1), do: "one" def foo(2), do: "two" Allen Madsen http://www.allenmadsen.com On Mon, Apr 5, 2021 at 8:38 AM eksper

Re: [elixir-core:9980] [Proposal] Make Kernel.tap/2 and Kernel.then/2 macros

2021-01-15 Thread Allen Madsen
I meant compile time. Allen Madsen http://www.allenmadsen.com On Fri, Jan 15, 2021 at 1:53 PM Allen Madsen wrote: > A macro should be able to tell if a function was passed in most cases at > runtime. > > Allen Madsen > http://www.allenmadsen.com > > > On Fri, Jan 15,

Re: [elixir-core:9980] [Proposal] Make Kernel.tap/2 and Kernel.then/2 macros

2021-01-15 Thread Allen Madsen
A macro should be able to tell if a function was passed in most cases at runtime. Allen Madsen http://www.allenmadsen.com On Fri, Jan 15, 2021 at 2:26 AM Fernando Tapia Rico wrote: > One benefit of implementing it with functions is the is_function guards, > which provide a bette

Re: [elixir-core:9852] Enum.fold/2 and Enum.fold/3

2020-12-09 Thread Allen Madsen
FWIW, I've always appreciated that reduce passes them in the order it does to the function, because it's the same order that they are passed into reduce, which has made it easy for me to remember the order they come in. Enum.reduce(items, acc, fn item, acc -> ... end) Allen Madsen h

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

2020-12-03 Thread Allen Madsen
:lt Enum.compare_count([1], 1) #=> :eq Enum.compare_count([1, 2], 1) #=> :gt 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 not a > great idea :) I couldn’t find examples in other L

Re: [elixir-core:9523] [Proposal] Extend the mix formatter to work with eex files.

2020-05-30 Thread Allen Madsen
proposed design for how such a thing might work though. Allen Madsen http://www.allenmadsen.com On Sat, May 30, 2020 at 8:39 AM Adam Lancaster < a...@channelviewestates.co.uk> wrote: > Hello > > It would be really great if the mix formatter could be configured to work > w

Re: [elixir-core:9441] Proposal: & should be able to create zero-arity functions

2020-03-30 Thread Allen Madsen
I'm +1 for this. I didn't see any justification for it in the commit that introduced it. https://github.com/elixir-lang/elixir/commit/46fae17b7ec9d752b918aa0fbcab3cf4d6e04359#diff-35be93cb9497f709353d9ed9b488949cR89-R90 Allen Madsen http://www.allenmadsen.com On Sun, Mar 29, 2020 at 7:56 PM

Re: [elixir-core:9390] Proposal: Multi-letter sigils

2020-02-15 Thread Allen Madsen
.Range<...> Allen Madsen http://www.allenmadsen.com On Sat, Feb 15, 2020 at 10:11 AM José Valim wrote: > I believe this is the best proposal on the topic so far. I agree with > trade-offs too (disclaimer: we have talked about those trade-offs privately > before). I would suggest

Re: [elixir-core:9345] PROPOSAL: Nil-safe Access.at/1

2020-01-30 Thread Allen Madsen
I'm in favor of them being nilsafe by default. Allen Madsen http://www.allenmadsen.com On Wed, Jan 29, 2020 at 11:24 AM Tor Bjornrud wrote: > I wouldn't mind having opts for something like this. Avoids creating a > slew of Access functions that then become difficult to sift t

Re: [elixir-core:9309] [Proposal] defrecord syntactic sugar like defstruct

2020-01-04 Thread Allen Madsen
Tilde (~) is already used for sigils, so it can't be used for this. Allen Madsen http://www.allenmadsen.com On Fri, Jan 3, 2020 at 5:41 PM Kevin Johnson wrote: > Thank you Alexei for clarifying. > > I did not see that you could use the macro in a pattern match like that. > T

Re: [elixir-core:9253] [Proposal] Create a sigil_P for PIDs, and use it for inspection

2019-10-24 Thread Allen Madsen
I'm +1 for this. Allen Madsen http://www.allenmadsen.com On Thu, Oct 24, 2019 at 3:33 PM Kelvin Raffael Stinghen < kelvin.sting...@gmail.com> wrote: > Maybe also, instead of using `[]` as delimiters we could use `<>`, so it’s > close to how it was before and also close to ho

Re: [elixir-core:9111] Prefix/Suffix map keys proposal

2019-09-20 Thread Allen Madsen
One other note, not all keys are atoms. Any term can be used as a key. Allen Madsen http://www.allenmadsen.com On Fri, Sep 20, 2019 at 10:17 AM Alexei Sholik wrote: > It's functionality that is very specific to a particular use case to be > added to a standard library module. Plus, it

Re: [elixir-core:9056] Re: Function.pipe_to/2

2019-08-13 Thread Allen Madsen
In case it's helpful to see. The function implementation of this would likely be something like this: defmodule Function do def pipe_to(val, fun) when is_function(fun, 1) do fun.(val) end end Allen Madsen http://www.allenmadsen.com On Tue, Aug 13, 2019 at 7:51 PM Allen Madsen wrote

Re: [elixir-core:9055] Re: Function.pipe_to/2

2019-08-13 Thread Allen Madsen
g |> String.upcase() |> fun.() end Though, I'm not sure what happens when there's shadowing of anonymous variables. Allen Madsen http://www.allenmadsen.com On Tue, Aug 13, 2019 at 5:34 PM Wiebe-Marten Wijnja wrote: > On 13-08-2019 11:03, José Valim wrote: > > > [...] if I h

Re: [elixir-core:8993] [Proposal] identity function

2019-07-30 Thread Allen Madsen
I don't have a strong opinion on this function's inclusion. It's not mandatory that it live in Kernel though. It could exist on Function. Allen Madsen http://www.allenmadsen.com On Tue, Jul 30, 2019 at 12:29 PM Chris McCord wrote: > I’m just catching up on this thread now, but

Re: [elixir-core:8983] [Proposal] Add public API to check if a test is async

2019-07-24 Thread Allen Madsen
Thanks, I just independently discovered that as well. Allen Madsen http://www.allenmadsen.com On Wed, Jul 24, 2019 at 11:09 AM Wojtek Mach wrote: > You can already check whether a given test is async by inspecting context, > perhaps it’s enough for your use cases? > > defmo

[elixir-core:8982] [Proposal] Add public API to check if a test is async

2019-07-24 Thread Allen Madsen
Imagine you want to do something like set application config in a test to test a behavior. You could do something like: setup do value = Application.get_env(:my_app, :my_key) on_exit(fn -> Application.put_env(:my_app, :my_key, value) end) :ok end test "changes value" do

Re: [elixir-core:8899] Re: [Proposal] identity function

2019-07-02 Thread Allen Madsen
And identity in mathematics: https://en.wikipedia.org/wiki/Identity_function Allen Madsen http://www.allenmadsen.com On Tue, Jul 2, 2019 at 4:05 PM Ryan Winchester wrote: > And `identity` in Scala > > docs: > https://www.scala-lang.org/api/current/scala/Predef$.html#ide

Re: [elixir-core:8883] [Proposal] Module.attribute_registered?/3 or Add Module.has_attribute?/3

2019-07-02 Thread Allen Madsen
> We need to document that once an attribute has been registered to accumulate or persist, it can't be done undone unless the attribute is deleted. How is it undone today? Allen Madsen http://www.allenmadsen.com On Tue, Jul 2, 2019 at 1:24 AM José Valim wrote: > Thanks for the pr

[elixir-core:8879] [Proposal] Module.attribute_registered?/3 or Add Module.has_attribute?/3

2019-07-01 Thread Allen Madsen
In working with the ExUnit code, there are at least two places where I think being able to introspect on module attributes would be useful. One is here . In this code it would be useful to know if a

Re: [elixir-core:8873] [Proposal] Add support for custom module and describe level attributes to ExUnit

2019-06-26 Thread Allen Madsen
that would break the accumulate option for the module attribute, because the user would have already defined the attribute before using the module that marked the attribute to accumulate. Maybe I'm misunderstanding something. I'll start work on this soon. Allen Madsen http://www.allenmadsen.com

Re: [elixir-core:8868] [Proposal] Add support for custom module and describe level attributes to ExUnit

2019-06-25 Thread Allen Madsen
FixtureCase @module_fixture "foo" # describes and tests end How can the case template get the module attribute in its setup block? Allen Madsen http://www.allenmadsen.com On Tue, Jun 25, 2019 at 3:33 PM José Valim wrote: > So I repropose my early proposal for register_describe_attri

Re: [elixir-core:8858] [Proposal] Add support for custom module and describe level attributes to ExUnit

2019-06-25 Thread Allen Madsen
If it were to mirror how tags work, it would always override. But it does seem more flexible to not force a particular strategy. So, I'm +1 for that. Allen Madsen http://www.allenmadsen.com On Tue, Jun 25, 2019 at 12:23 PM José Valim wrote: > If :fixture is a string, then automatic merg

Re: [elixir-core:8854] [Proposal] Add support for custom module and describe level attributes to ExUnit

2019-06-25 Thread Allen Madsen
) # uses @module_fixture Then you could know they all go under the same fixture key. Allen Madsen http://www.allenmadsen.com On Tue, Jun 25, 2019 at 8:08 AM José Valim wrote: > But how would you know they all go under the same @fixture key? > > > *José Valim* > www.plataformatec

Re: [elixir-core:8852] [Proposal] Add support for custom module and describe level attributes to ExUnit

2019-06-25 Thread Allen Madsen
of tags for registered attributes. Allen Madsen http://www.allenmadsen.com On Tue, Jun 25, 2019 at 1:31 AM José Valim wrote: > Hi Allen, good proposal! > > I don't believe we need to support these for module attributes, as there > is no clean or book keeping to be done. >

[elixir-core:8851] [Proposal] Add support for custom module and describe level attributes to ExUnit

2019-06-24 Thread Allen Madsen
ExUnit supports tags at the test, describe, and module level. You can easily add your own attribute with ExUnit.Case.register_attribute/3, however, it only works at the test level. As it is, to simulate attributes at the describe and module level, you'd have to replace parts of ExUnit or

Re: [elixir-core:8830] [Proposal] Add "MIX_DEPS_PATH" env var support

2019-06-11 Thread Allen Madsen
passed in a keyword list in a mix.exs file. https://hexdocs.pm/mix/master/Mix.Project.html#module-configuration Allen Madsen http://www.allenmadsen.com On Tue, Jun 11, 2019 at 2:42 AM Unified Front wrote: > Hi all > > Sorry for jumping in here, but shouldn’t that be somet

Re: [elixir-core:8828] [Proposal] Add "MIX_DEPS_PATH" env var support

2019-06-10 Thread Allen Madsen
Is there a reason that it's insufficient to do: deps_path: System.get_env("MIX_DEPS_PATH") || "deps" Allen Madsen http://www.allenmadsen.com On Mon, Jun 10, 2019 at 4:45 PM Philip Sampaio wrote: > Hi guys, > > We currently have some environment variables availa

Re: [elixir-core:8819] Re: Add type guards to structs

2019-05-30 Thread Allen Madsen
You're probably better off using an ecto schema and changeset. Allen Madsen http://www.allenmadsen.com On Thu, May 30, 2019 at 10:27 AM Francesco Lo Franco < lofranco.france...@gmail.com> wrote: > Sorry to dig up this very old post, but I thought I wanted to just +1 this > prop

Re: [elixir-core:8627] Proposal: atom creation callback in tokenizer

2019-04-10 Thread Allen Madsen
For those of us who haven't seen your talk, what's the reason for wanting to add this? Allen Madsen http://www.allenmadsen.com On Wed, Apr 10, 2019 at 7:50 AM Arjan Scherpenisse wrote: > Hello all, > > As I discussed with José on ElixirconfEU after my talk on the parser, I > would

Re: [elixir-core:8588] [proposal] Tree-Sitter grammar parser for Elixir

2019-04-03 Thread Allen Madsen
I don't see this as something core wants to take on, but it would be great if there were a group of people dedicated to editor support. The closest thing to that right now is: https://github.com/elixir-lsp Allen Madsen http://www.allenmadsen.com On Wed, Apr 3, 2019 at 8:50 AM Norbert Melzer

Re: [elixir-core:8525] [Feature proposal] @enforce_keys should accumulate

2019-03-07 Thread Allen Madsen
You'd have to try this out, but it might work to add the additional enforced keys in __before_compile__ instead. Allen Madsen http://www.allenmadsen.com On Thu, Mar 7, 2019 at 8:20 AM José Valim wrote: > This is tricky because I can see someone using @enforce_keys to define a > default

Re: [elixir-core:8419] [Proposal] Enum.split_with/2 to Enum.split_by/2

2018-12-31 Thread Allen Madsen
a slight leaning towards operations that work on multiple elements, such as specifying the sorting function which would compare two elements together. However, there are many cases where they could be interchangeable. Allen Madsen http://www.allenmadsen.com On Mon, Dec 31, 2018 at 9:44 AM José

Re: [elixir-core:8410] Support for Half Float representation

2018-12-18 Thread Allen Madsen
fit fine in a normal float. When it get's serialized, there may be some data loss as it get's converted to a lower precision value, but that's likely to be ok in this case. Allen Madsen http://www.allenmadsen.com On Tue, Dec 18, 2018 at 1:41 AM Zubair wrote: > Half float representation is u

Re: [elixir-core:8399] Re: Proposal: Inspect for records

2018-12-16 Thread Allen Madsen
Couldn't you define a method like __record_keys__/0 on the atom in the defrecord call? Allen Madsen http://www.allenmadsen.com On Sat, Dec 15, 2018 at 11:49 AM wrote: > One way to avoid issues with state is to avoid... state. Maybe we'd > configure it like this: > > records = [ &g

Re: [elixir-core:8395] [Proposal] Add zip_by/4 to the Enum module

2018-12-14 Thread Allen Madsen
I think it's better as a library. Also, wow, did I butcher the spelling of niche. Allen Madsen http://www.allenmadsen.com On Fri, Dec 14, 2018 at 9:31 AM Florian Odronitz wrote: > That’s correct, pair_by would be a better name since it forms pairs by the > return value of the match fu

Re: [elixir-core:8393] [Proposal] Add zip_by/4 to the Enum module

2018-12-14 Thread Allen Madsen
_by-{-ITEMFUNC-}-\@arr0,-\@arr1,-\@arr2,. .. However, this could just as easily be handled by: [ [1, 2], ~w(one two) ] |> Enum.zip() |> Enum.map(fn {num, word} -> "#{num} is #{word}" end) #=> ["1 is one", "2 is two"] Allen Madsen http://www.allen

Re: [elixir-core:8354] Re: [Proposal] Remove ":" from stacktrace output

2018-10-24 Thread Allen Madsen
uit) lib/mix/tasks/conduit.gen.broker.ex:26: Mix.Tasks.Conduit.Gen.Broker.run/1 test/mix/tasks/conduit.gen.broker_test.exs:18: (test) Allen Madsen http://www.allenmadsen.com On Wed, Oct 24, 2018 at 4:53 PM OvermindDL1 wrote: > Maybe the test should accept a filename and line combi

Re: [elixir-core:8333] Proposal: provide a basic set of crypto modules for use with Elixir

2018-10-03 Thread Allen Madsen
Allen Madsen http://www.allenmadsen.com On Wed, Oct 3, 2018 at 7:45 PM Mark Madsen wrote: > Crypto is super hard. And super important. > > Currently Elixir pushes users to call Erlang when working with crypto. > This doesn't align with Elixirs goal of developer productivity. >

Re: [elixir-core:8319] [Proposal] Allow guards to be interspersed anywhere in clause heads

2018-09-24 Thread Allen Madsen
If the goal were primarily macro usage, wouldn't this type of thing already be possible with a macro today? Allen Madsen http://www.allenmadsen.com On Mon, Sep 24, 2018 at 11:34 AM Christopher Keele wrote: > That's a good point. I suspect the convention around manual usage would > co

Re: [elixir-core:8317] [Proposal] Allow guards to be interspersed anywhere in clause heads

2018-09-24 Thread Allen Madsen
Instead of: def foo((%{x: x} when x > 1) = result), do: 1 Allen Madsen http://www.allenmadsen.com On Mon, Sep 24, 2018 at 10:13 AM Christopher Keele wrote: > This is a more formal write-up of the discussion started with José here > <https://elixirforum.com/t/internal-guards/1672

Re: [elixir-core:8242] Re: Proposal: make Application.get_env being able to resolve {:system, var} tuple out of the box

2018-08-06 Thread Allen Madsen
is likely to encourage less configuration in config and move more of it into the supervisor inits. Allen Madsen http://www.allenmadsen.com On Mon, Aug 6, 2018 at 5:33 PM Ivan Yurov wrote: > I agree that in general this is not something that should be defined in > the language core or the standa

Re: [elixir-core:8020] Proposal: Moving towards discoverable config files

2018-05-24 Thread Allen Madsen
FYI, most of the discussion is happening on the forum: https://elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/73 Allen Madsen http://www.allenmadsen.com On Thu, May 24, 2018 at 12:33 AM, Austin Ziegler <halosta...@gmail.com> wrote: > This is an interes

Re: [elixir-core:7642] [Proposal/Feedback] Changes to Logger to introduce off-by-default semantics

2017-12-01 Thread Allen Madsen
. It doesn't matter if a dependency exposes an application. Allen Madsen http://www.allenmadsen.com On Fri, Dec 1, 2017 at 8:18 PM, Isaac Whitfield <i...@whitfin.io> wrote: > Hey Pedro, > > I've carried out an informal poll with various people (5-10 developers) > "what do y

Re: [elixir-core:7620] Option to re-run only tests that failed last time?

2017-11-23 Thread Allen Madsen
+1 for --next-failure functionality. My current approach with ExUnit is basically a manual version of that. Allen Madsen http://www.allenmadsen.com On Thu, Nov 23, 2017 at 12:28 PM, Myron Marston <myron.mars...@gmail.com> wrote: > I believe this would be a good addition. My only

Re: [elixir-core:7565] [Proposal] Warning when `GenServer.stop` is called with the current processes' pid

2017-10-25 Thread Allen Madsen
for Erlang. If there's some caveat to why this needs to be allowed, I think at least documentation for GenServer.stop/3 would be worthwhile. Allen Madsen http://www.allenmadsen.com On Wed, Oct 25, 2017 at 3:28 PM, Josh B <joshuabo...@gmail.com> wrote: > > Just ran into a nasty littl

Re: [elixir-core:7543] Is it possible to have an `is_module` function?

2017-10-16 Thread Allen Madsen
This is the best way I know how to determine if it's a module vs an atom. function_exported?(X, :__info__, 1) You won't be able to use it in a guard though. Allen Madsen http://www.allenmadsen.com On Mon, Oct 16, 2017 at 3:10 PM, Martin Svalin <martin.sva...@gmail.com> wrote: > Th

Re: [elixir-core:7424] [Proposal] Warn when using quoted atoms with trailing commas in maps

2017-09-13 Thread Allen Madsen
exploring adding this to credo, in case it doesn't make sense for Elixir core. Allen Madsen http://www.allenmadsen.com On Wed, Sep 13, 2017 at 6:16 PM, Allen Madsen <bla...@gmail.com> wrote: > At work we deal with a lot of JSON and so it's common to have the > equivalent of JSON in

Re: [elixir-core:7415] [Proposal] Auto merge mix.lock when there are merge conflicts

2017-09-09 Thread Allen Madsen
Issue created here: https://github.com/elixir-lang/elixir/issues/6554 Allen Madsen http://www.allenmadsen.com On Sat, Sep 9, 2017 at 12:45 AM, José Valim <jose.va...@plataformatec.com.br > wrote: > If we do the merging choosing the ones that match the current requirements > then

Re: [elixir-core:7413] [Proposal] Auto merge mix.lock when there are merge conflicts

2017-09-08 Thread Allen Madsen
, if it's not, go back to step 3, if all the permutations were tried and none were valid, bail out. Finally, if there are some edge cases that aren't handled, bail out and state why. This feels like something that doesn't need to be perfect from the beginning. Just good enough. Allen Madsen http

Re: [elixir-core:7407] [Proposal] Auto merge mix.lock when there are merge conflicts

2017-09-08 Thread Allen Madsen
I haven't looked too much myself, but this is the PR that added it. https://github.com/yarnpkg/yarn/pull/3544/files Allen Madsen http://www.allenmadsen.com On Thu, Sep 7, 2017 at 9:05 PM, José Valim <jose.va...@plataformatec.com.br> wrote: > That's an interesting feature. Does anyone

[elixir-core:7406] [Proposal] Auto merge mix.lock when there are merge conflicts

2017-09-07 Thread Allen Madsen
Yarn 1.0 was released today and in the blog post they mention that they've added auto merge for yarn.lock files [1]. Having run into this issue and resolved it manually, I can attest to how painful it is. So, I'd like to propose we bring this feature to mix deps. [1]:

Re: [elixir-core:7401] [Proposal] DateTime.now_unix/1

2017-08-30 Thread Allen Madsen
It doesn't make a whole lot of sense to me to have a function on DateTime that doesn't produce or accept a DateTime. You can use :os.system_time() or :os.system_time(:second) if you want to get straight to the unix time. Allen Madsen http://www.allenmadsen.com On Wed, Aug 30, 2017 at 6:11 PM

Re: [elixir-core:7102] Development Machines

2017-04-28 Thread Allen Madsen
a couple layers on mac. Allen Madsen On Fri, Apr 28, 2017 at 11:31 AM, shiroyasha <igi...@gmail.com> wrote: > I have played around with the idea of using docker as a development > environment for developing elixir. It works very nice, and it would allow > us quickly compile on mo

Re: [elixir-core:7070] Re: Proposal: Enum.take/1

2017-04-20 Thread Allen Madsen
Also hd, which takes the head of the list. Allen Madsen http://www.allenmadsen.com On Thu, Apr 20, 2017 at 12:44 PM, OvermindDL1 <overmind...@gmail.com> wrote: > Two things: > 1. The `List` module already has a `List.first/1`. > 2. Not all enumerables have a concept of ordering,

Re: [elixir-core:6956] Is this a bug in my brain or the compiler?

2017-02-23 Thread Allen Madsen
Paul, I thought so as well, but ^n is necessary in a map. Otherwise it produces this error: illegal use of variable n inside map key match, maps can only match on existing variable by using ^n Allen Madsen http://www.allenmadsen.com On Thu, Feb 23, 2017 at 3:05 AM, José Valim <jose

Re: [elixir-core:6834] Proposal: Logger.inspect

2017-01-23 Thread Allen Madsen
I'd guess the primary motivation would be to allow usage in a pipeline. Allen Madsen On Mon, Jan 23, 2017 at 3:29 AM, José Valim <jose.va...@plataformatec.com.br > wrote: > Given the same can be achieved with Logger.debug(inspect(foo)), why > introduce a new macro? > >

Re: [elixir-core:6737] Re: Kernel.compare/2 and Comparable protocol

2016-12-14 Thread Allen Madsen
the `+` method from `obj` instead of `1`. The swapping of arguments are only useful as long as the operations are commutative, though. Anyways, thought I'd mention the prior art in case it's useful. Allen Madsen http://www.allenmadsen.com On Wed, Dec 14, 2016 at 6:49 AM, Wiebe-Marten Wijnja < w.m.

Re: [elixir-core:6727] Improving Access for working with nested structs

2016-12-08 Thread Allen Madsen
Elixir could define Access.keys/1, which would work like the following: Access.keys([:foo, bar]) == [Access.key(:foo), Access.key(bar)] For defaults, you would use a tuple of key and default. Access.keys([{:foo, %{}}, bar]) == [Access.key(:foo, %{}), Access.key(bar)] Allen Madsen http

Re: [elixir-core:6725] Improving Access for working with nested structs

2016-12-08 Thread Allen Madsen
Would it be acceptable and sufficient, when using the defstruct macro, to define default implementations of the methods required for the Access behaviour? Allen Madsen http://www.allenmadsen.com On Thu, Dec 8, 2016 at 5:20 AM, Ólafur Arason <olafur...@gmail.com> wrote: > What is

Re: [elixir-core:6716] [Proposal] Implement String.Chars for Exceptions

2016-12-07 Thread Allen Madsen
ion [:message] defimpl String.Chars, for: Y do def to_string(y), do: inspect(y) end end try do raise Y, "y" rescue error -> Logger.error(error) end # 08:18:01.364 [error] %Y{message: "y"} Allen Madsen http://www.allenmadsen.com On Wed, Dec 7, 2016 at 4:03 AM, José Va

[elixir-core:6714] [Proposal] Implement String.Chars for Exceptions

2016-12-06 Thread Allen Madsen
Hi all, I was trying to log an exception and noticed that this does not work: Logger.error(exception). Logger could handle this case itself, but I think it would be better to handle it more generically. So, I propose when a module uses the defexception macro, that Elixir automatically define

Re: [elixir-core:6698] I think the new 1.4 warning about missing () on zero arity functions is a cure that's worse than the disease

2016-12-05 Thread Allen Madsen
he method coming from a module import, I would expect it to tell me what import included the method that is causing the conflict. Allen Madsen http://www.allenmadsen.com On Mon, Dec 5, 2016 at 9:25 AM, Ólafur Arason <olafur...@gmail.com> wrote: > I don't have horse in the race, I'm fine

Re: [elixir-core:6671] I think the new 1.4 warning about missing () on zero arity functions is a cure that's worse than the disease

2016-12-03 Thread Allen Madsen
to be a compiler error in Elixir 2.0? If so, does that mean that we would be able to call anonymous functions without the dot? x = fn y -> y + 1 end x(1) # vs x.(1) Allen Madsen http://www.allenmadsen.com On Sat, Dec 3, 2016 at 9:07 AM, Amos King <a...@binarynoggin.com> wrote: > In my experience

Re: [elixir-core:6629] DateTime.from_iso8601 function is missing

2016-11-29 Thread Allen Madsen
As another data point, I've built 5 apps that only use UTC and iso8601 for transport. This feature is much appreciated since it's pretty much the only reason I use Timex. Allen Madsen On Mon, Nov 28, 2016 at 6:20 PM, José Valim <jose.va...@plataformatec.com.br> wrote: > We h

Re: [elixir-core:6470] Add mix release task similar to rake release

2016-10-11 Thread Allen Madsen
Hey John, Aleksei's package is for automating package releases to hex rather than application releases for deployment. Allen Madsen http://www.allenmadsen.com On Tue, Oct 11, 2016 at 11:20 AM, John Hamelink <j...@farmer.io> wrote: > I'd like to put forward my usecase for

Re: [elixir-core:6455] Mix todos/notes feature

2016-10-06 Thread Allen Madsen
ag -A TODO Finds all TODO's grouped by file and shows the following 2 lines (-A) for context. ag is specifically for searching code projects and respects .gitignore. Allen Madsen http://www.allenmadsen.com On Thu, Oct 6, 2016 at 8:39 AM, Louis Pop <louispopin...@gmail.com> wrote: > Hel

Re: [elixir-core:6377] Re: Deprecate 'single quotes for char lists'

2016-09-22 Thread Allen Madsen
+1 from me. When I teach people Elixir, I skip over char lists. By the time they need to use them, they're typically at the point that they're mentally able to understand them without being overloaded. Allen Madsen http://www.allenmadsen.com On Thu, Sep 22, 2016 at 3:13 PM, José Valim <jose

Re: [elixir-core:6350] Add mix release task similar to rake release

2016-09-21 Thread Allen Madsen
I agree with Alexsei that it is pretty standard. If you want to do something off the beaten path, you still have that option with the individual commands available. Allen Madsen http://www.allenmadsen.com On Wed, Sep 21, 2016 at 7:29 AM, Alexsei Matiushkin < aleksei.matiush...@kantox.com>

Re: [elixir-core:6311] modules that are required automatically

2016-09-13 Thread Allen Madsen
Both `import` and `use` will do the require for you. See: http://elixir-lang.org/getting-started/alias-require-and-import.html Until I read this, I also didn't understand why I didn't need to use require everywhere. Allen Madsen http://www.allenmadsen.com On Tue, Sep 13, 2016 at 9:02 AM, Louis

Re: [elixir-core:6258] [proposal] Kernel.fetch_in

2016-08-29 Thread Allen Madsen
+1 from me. Seems consistent with `get_in` and `put_in` and follows the semantics of `fetch`. Allen Madsen http://www.allenmadsen.com On Mon, Aug 29, 2016 at 7:11 AM, Brian Cardarella <br...@dockyard.com> wrote: > When using `with` there are several times I wish I could have reach

Re: [elixir-core:6111] Application.process_tree

2016-07-15 Thread Allen Madsen
+1 for the process tree being available via command line. I also want to be able to visualize it on a server where :observer is not an option. Allen Madsen http://www.allenmadsen.com On Fri, Jul 15, 2016 at 9:51 AM, Adam Lindberg <he...@alind.io> wrote: > Yeah, a family of such functi