…two gotchas mean i don't want it in master for now:
let x: number|undefined;
const y = Option.of(x);
=> Inferred to Some<number|undefined> <-- i never want that type!
Need Option.from(x) to make it work.
another one:
List.of(Option.of(5), Option.none())
doesn't compile anymore. It says None is not compatible with Some.
Need List.of<Option> to make it work.
Also generally speaking I'm not sure it brings much apart from simple demos
(and making super nice apidocs) -- in the real world you don't deal with Some
and None much -- pretty quickly it's all Option anyway.
…two gotchas mean i don't want it in master for now:
let x: number|undefined; const y = Option.of(x);
=> Inferred to Some<number|undefined> <-- i never want that type!
Need Option.from(x) to make it work.
another one:
List.of(Option.of(5), Option.none())
doesn't compile anymore. It says None is not compatible with Some.
Need List.of<Option> to make it work.
Also generally speaking I'm not sure it brings much apart from simple demos (and making super nice apidocs) -- in the real world you don't deal with Some and None much -- pretty quickly it's all Option anyway.