Comments (2)
Here is an answer with concrete types for the next guy:
(->> [(exception/success 1) #_(exception/failure 42) (exception/success 2)]
(reduce #(mlet [acc %1 v %2] (cats/return (conj acc v))) (exception/success [])))
=> #<Success [1 2]>
(->> [(exception/success 1) (exception/failure 42) (exception/success 2)]
(reduce #(mlet [acc %1 v %2] (cats/return (conj acc v))) (exception/success [])))
=> #<Failure #error {:message "", :data 42}>
Shouldn't this be provided by the library?
from cats.
👍 for generic sequence
and traverse
for all functorial types f t
where (satisfies? Seqable t)
.
from cats.
Related Issues (20)
- Why is the implementation of rights not extracting the values from right? HOT 4
- No such namespace: promesa.impl.proto (required from cats.labs.promise) HOT 1
- foldl Documentation Example fail HOT 1
- lift-a produces an exception when n is (inc 1) but not when n is 2 HOT 1
- maybe/nothing doesn't have to be a function
- Please release fmap fix HOT 10
- doc for fapply - wrap in the same context as af?
- Documentation is broken HOT 3
- Reflections in the state monad HOT 3
- 2.3.0 not available on clojars HOT 6
- Missing tag 2.3.1 HOT 1
- Can't build the 2.3.1: failed compiling file:src/cats/monad/state.cljc HOT 1
- Naming conventions
- Add a jupyter notebook with the documentation. HOT 2
- cats.labs.promise support for promesa 2.x
- Error printing return value of try monad in REPL HOT 3
- Apparent inconsistent behaviour of alet compared to mlet HOT 2
- Code examples in the documentation don't return what's expected
- Cats does not work with new versions of Promesa
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 cats.