Re: [elixir-core:6481] add record/2 to Typespecs

2016-10-12 Thread eksperimental
great. thank you On Wed, 12 Oct 2016 20:03:59 +0200 José Valim wrote: > The record/2 macro is defined in the Record module so I would keep things > contained in the Record module and not link it to in typespecs, specially > because it is a regular Elixir macro and not a typespec construct. > >

Re: [elixir-core:6480] add record/2 to Typespecs

2016-10-12 Thread José Valim
The record/2 macro is defined in the Record module so I would keep things contained in the Record module and not link it to in typespecs, specially because it is a regular Elixir macro and not a typespec construct. *José Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D

[elixir-core:6479] add record/2 to Typespecs

2016-10-12 Thread eksperimental
Hi, I'm reviewing some documentation and I found this, ## Types Types can be defined for tuples with the `record/2` macro (only available in typespecs). This macro will expand to a tuple as seen in the example below: defmodule MyModule do require Record Record.defreco

Re: [elixir-core:6478] Enumerable implementation

2016-10-12 Thread José Valim
It is for optimization purposes. We could implement all? on top of the reduce but that would imply dispatching to the protocol, then to the implementation and then process the reduce operation. So we skip all of that by dispatching to the local implementation. Another way to put it: sometimes you

Re: [elixir-core:6478] Suggestion: Mix should automatically recompile projects when config changes

2016-10-12 Thread jbodah
Ah it looks like this is the case for standalone apps, but it's not the case for sub-apps generated inside an umbrella project. That is, if I change the config in one of my sub-apps then recompilation will not happen and running `mix test` will not reflect changes to the sub-app's configs. I'm

Re: [elixir-core:6476] Suggestion: Mix should automatically recompile projects when config changes

2016-10-12 Thread Eric Meadows-Jönsson
Mix does automatically recompile the project if a config file in config/ changes, it does not recompile dependencies if that's what you are referring to. On Wed, Oct 12, 2016 at 4:37 PM, wrote: > I feel like a common idiom in Elixir is to define environment-specific > variables using module attr

[elixir-core:6476] Enumerable implementation

2016-10-12 Thread Jay Hayes
Today I'm studying Elixir protocols and stumbled upon something I found curious. Enumerable came to mind pretty quickly for me as a good example for protocols. The interesting thing that I noticed is the default implementations of Enumerable for Elixir types is a little underwhelming. In parti

[elixir-core:6475] Suggestion: Mix should automatically recompile projects when config changes

2016-10-12 Thread jbodah
I feel like a common idiom in Elixir is to define environment-specific variables using module attributes so that each environment's changes can be compiled directly (instead of being called dynamically). The most obvious place to define these module attributes is in the respective config direct