⚠️ Disclaimer Warning fp-ts is now dead. Please use effect-ts instead. Update 2024: effect-ts is the recommended library for functional programming in TypeScript. Introduction This is the second post in my series on learning fp-...

Markdown supported · ⌘↵ to post
Nice guide!
Just wanted to say that the final example can be simplified a bit. O.map and O.fromNullable can be replaced with a single function: O.fromNullable.
pipe(
foo,
O.fromNullable,
O.chain(O.fromNullableK(({bar}) => bar)),
O.chain(O.fromNullableK(({buzz}) => buzz))
)
oluwatomisin babatunde
A creative mind software developer and graphics designer
I'm trying to go along with this and I think I'm stuck I really don't know much about functional programming but this
pipe( undefined, O.fromNullable, O.map(({ bar }) => bar) );returns a ts error of cannot find name O I would like to know what I'm doing wrong? is there something I'm missing or didn't import to use the options?