traverse1984 / oxide.ts

Rust's Option<T> and Result<T, E>, implemented for TypeScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

andThen "f" argument is wrongfully typed

SteakOvercooked opened this issue · comments

commented

Doc comments say that the usage of andThen goes like this:

const opt = Some(1).andThen((val) => val + 1);

Which is wrong because it actually expects you create an Option with the result:

const opt = Some(1).andThen((val) => Some(val + 1));