typelevel / typelevel/cats

IndexedStateT has superfluous parts

Open
#4,537 5 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

Digging into the definition of IndexedStateT we find

F[(SA) ⇒ F[(SB, A)]]

but that outer F isn't motivated by anything in the underlying theory.

(SA) ⇒ F[(SB, A)]

is actual indexed state. The extra outer F[_] seems to have slipped in as a sort of Cayley-like construction, but it goes conspicuously unused, and if you attempt to use it to say slip another layer of F effects in during the glue-up of your computation, you'll violate laws left and right for non-commutative choices of F[_]. The inner F is motivated by the fact that you can distribute the (SA) => out of any F[] using strength, and (SB,) in using strength.

Is there any documentation motivating/justifying this extra outer effect layer?

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 with the IndexedStateT definition and the theoretical reasoning described in the issue. Determine whether existing documentation justifies the outer F layer or whether the issue calls for a design decision; done means the motivation and intended direction are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
developer-experience
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.