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