Comments (2)
Hi @artydev, yes an error would be thrown here because of the lack of encase
and chain
, or more appropriately nullable
and chain
in this example.
Would you be able to update the docs with something like this?
nullable(data)
.map(people => people.filter(person => person.cool))
.chain(people => nullable(people[0]))
.map(person => person.name)
.map(name => name.toUpperCase())
.cata({
Just: data => console.log(data),
Nothing: () => console.log('No data available')
})
from pratica.
@rametta
Thank you very much, it's totally understandable
from pratica.
Related Issues (12)
- shouldn't chain be called flatMap? HOT 1
- Curry or functional lenses ? HOT 1
- Esm output format? HOT 1
- Why doesn't this library have a curry function? HOT 2
- map is able to create Just(null) HOT 5
- ascasc
- Result should require a non empty value HOT 5
- Q: Why does the example for Maybe.cata and Result.cata divide the input height by 2.2? HOT 4
- Publish as Deno Module HOT 2
- Result.value
- Async functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pratica.