typelevel / typelevel/cats

Consider making transformer types non-final

Open
#434 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

It's common to want simple names for transformer stacks, eg.,

type OptionalWork[T] = OptionT[Work, T]

Type aliases are somewhat second class in Scala however. In particular they don't have proper companion objects, and objects of the same name aren't searched for corresponding implicit definitions.

If transformers were non-final it would be possible to define a trait rather than a type alias,

trait OptionalWork[T] extends OptionT[Work, T]

In which case a useful companion object would be a possibility.

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 examining the OptionT transformer and the related transformer type definitions, focusing on their use of final classes and companion objects. Check how Scala inheritance and implicit lookup would behave for a named transformer trait such as OptionalWork. Done should include a decided compatibility and API design direction, rather than only a local edit.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.