fold is bimap
See original GitHub issueI got a question about fold
, so I took a look at the signature:
@Task(α, β) => (α → γ), (β → γ) → Task(δ, γ)
This is not a fold, this is bimap.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Data.Bimap - Hackage
A Bimap is essentially a bijection between subsets of its two argument types. ... Fold the association pairs in the map, such that...
Read more >TryAsyncExtensions.BiMap is actually a Fold, not a BiMap #563
I think TryAsyncExtensions.BiMap should either be renamed to Fold if the behavior is intended, or changed to allow a proper bimap to happen....
Read more >Either (Vavr 0.9.3 API) - javadoc.io
Folds either the left or the right side of this disjunction. ... default <X,Y> Either<X,Y> bimap(Function<? super L,? extends X> leftMapper, ...
Read more >Folds and Unfolds
Lecture 1: folds and unfolds ... fold IntList :: B ->(Int + B+ B) → Intlist - B fold Int List ef NilI...
Read more >Advanced FP for the Enterprise Bee: Shiny Things - Medium
Unlike bimap the fold operation returns a value instead of a container. So whereas applying bimap to an Either would produce another Either, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Folktale 2’s task only has
willMatchWith
. No way of writingfold
without deep coroutines/fibers or threads 😦@raqystyle an arbitrary type variable. There it just means it’s not the same type as
a
, but it doesn’t have any equivalent runtime set of values (it’s not reallyunit
ornull
). In that sense, it’s closer to TypeScript’snever
.@robotlolita thank you for the explanation!