Add missing semi-/sub-/-F/-Tap versions of flatMap to monad transformers
Open
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 5.5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
Monad transformers lack some semi-/sub-/-F/-Tap versions of flatMap that free a user from manual lifting or mapping.
I find the following items reasonable for implementation as to make structures and transformers more consistent:
- OptionT:
- add member methods
flatTap,flatTapF,semiflatTap,subflatTap
- add member methods
- Either:
- add extensions
flatTap,leftFlatTaptoEitherOpssyntax class
- add extensions
- EitherT:
- add member methods
leftFlatMapF,leftSubflatMap - add member methods
flatTap,flatTapF,semiflatTap,subflatTap - add member methods
leftFlatTap,leftFlatTapF,leftSemiflatTap,leftSubflatTap - add member methods
biSemiflatTap
- add member methods
- Ior:
- add member methods
leftFlatMap - add member methods
flatTap,leftFlatTap
- add member methods
- IorT:
- add member methods
leftFlatMapF,leftSubflatMap - add member methods
flatTap,flatTapF,semiflatTap,subflatTap - add member methods
leftFlatTap,leftFlatTapF,leftSemiflatTap,leftSubflatTap
- add member methods
- IdT:
- add member methods
flatTap,flatTapF
- add member methods
- WriterT:
- add member methods
flatMapF,semiflatMap,subflatMap - add member methods
flatTap,flatTapF,semiflatTap,subflatTap
- add member methods
- Kleisli:
- add member methods
flatTap,flatTapF
- add member methods
- IndexedStateT:
- add member methods
flatTap,flatTapF
- add member methods
- IndexedReaderWriterStateT:
- add member methods
flatTap,flatTapF
- add member methods
Open questions:
-
flatTapautomatically comes fromFlatMapsyntax. For some transformers it has a special implementation (e.g. for EitherT), for others it is standard (e.g. for OptionT). Should we add it to the latter for symmetry and consistency? (Added) - EitherT has
biSemiflatMap. DoEither/EitherT/Ior/IorTneedbiFlatMapwith all thesemi-/sub-/-F/-Tapversions?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing flatMap, biSemiflatMap, and related semi-/sub-/-F/‑Tap APIs across Either, EitherT, Ior, and IorT. The listed implementation items are marked complete, so the remaining work is to determine whether biFlatMap and its variants are needed and define what completion means before changing the transformer APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100