typelevel / typelevel/cats

Kleisli: flatMapF and andThen are the same

Open
#711 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
5.5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
5

Description

Currently Kleisli has two methods flatMapF and andThen that have duplicated type signatures and implementations.

This andThen is an overloaded version that takes a function as opposed to a Kleisli.

I propose keeping flatMapF and removing the andThen that uses Function1 to prevent confusion and avoid overloading. What do people think?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Kleisli definition and compare the flatMapF and Function1-based andThen signatures and implementations. Check their usages and the three existing comments before deciding whether the overload can be removed; done means the API decision is resolved and affected references remain consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.