question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I 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:open
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
robotlolitacommented, Oct 26, 2017

Folktale 2’s task only has willMatchWith. No way of writing fold 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 really unit or null). In that sense, it’s closer to TypeScript’s never.

0reactions
raqystylecommented, Oct 26, 2017

@robotlolita thank you for the explanation!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found