typelevel / typelevel/cats

Confusion about Instances{peano}: document reasoning behind Instances0, Instances1, ..

Open
#997 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I submitted my first, albeit small PR just now. One thing that confused me was the presence of traits like: XInstances0, XInstances1, XInstances2, etc. I understand the existence of XInstances but why are they spread over the naturals like that?

This gave me a little anxiety when I was submitting my first PR because I wanted to ensure I put my first instance in the right place. I have no idea where my instance resides in the peano hierarchy of random instances, nor, given my scala experience, could I infer why things were designed this way.

Suggestions:

  • somewhere in documentation (or contributing guidelines) give historical reasoning for this design choice.
  • in same documentation give simple criteria for how to determine which peano trait to place your instance.

I hope that's clear. Also, I'm so curious to find out the history behind this!

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 XInstances, XInstances0, XInstances1, and related Peano traits in the Cats repository, then review the documentation or contributing guidelines suggested in the issue. Research the historical reason for splitting instances across the hierarchy and define simple criteria for choosing a trait. Done means the reasoning and placement guidance are documented for newcomers.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.