Re: [elixir-core:7919] Re: [Proposal] Create maybe(t) typespec

2018-02-27 Thread Andrea Leopardi
I second what Ben said. {:ok, t} | :error isn't doable as it isn't "universal", sometimes you have just :ok and sometimes just :error for example. I think both as far as clarity goes as well as as far as conciseness goes the best solution is to use nil | t. On Tue, 27 Feb 2018 at 13:31, Ben

[elixir-core:7919] Re: [Proposal] Create maybe(t) typespec

2018-02-27 Thread Ben Wilson
maybe(t) is traditionally `Some(t) | None`, which isn't really the same as `nil | t`. The closest analogue would seem to me to be `{:ok, t} | :error` although that doesn't quite communicate the same thing. On Tuesday, February 27, 2018 at 7:11:39 AM UTC-5, Yordis Prieto wrote: > > Introducing

[elixir-core:7918] [Proposal] Create maybe(t) typespec

2018-02-27 Thread Yordis Prieto
Introducing `maybe(t)` it will reduce the boilerplate code for `nil | something` It is more convenience to write it this way, at least for me. What are your thoughts about it? -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To

Re: [elixir-core:7917] Enhancement request: parse character offsets for AST node

2018-02-27 Thread Serge Smetana
Hi, Sounds reasonable but may not work as good. This may change a lot of user formatted code and produce extra diffs in tests. If we could only reformat a part of the AST (one function call in our case) this would be ideal. Thanks, Serge. On Monday, February 26, 2018 at 2:31:01 PM UTC+2,