typelevel / typelevel/tsc

Project Submission: Number

Open
#179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

projects
Dominant language
No language data
Stars
11
Forks
4
Avg merge
1h 49m
Merged PRs (30d)
2

Description

Project Name

Number

Project Short Description

This project provides exact and fuzzy numeric computation with lazy evaluation in Scala.

Project Type

In accordance with the Typelevel Charter, I am proposing the project be a:

  • Organization Project
  • Affiliate Project
Project Management

All Typelevel projects follow the Typelevel Code of Conduct.
Organization projects do not need a CODE_OF_CONDUCT.md file, as the Typelevel GitHub Organization one will automatically apply.

Affiliate Project Instructions

Affiliate projects should copy the following template into a CODE_OF_CONDUCT.md file in their repo:

# Code of Conduct

Every member of our community has the right to have their identity respected. The Typelevel community is dedicated to providing a positive experience for everyone, regardless of age, gender identity and expression, sexual orientation, disability, neurodivergence, physical appearance, body size, ethnicity, nationality, race, or religion (or lack thereof), education, or socio-economic status.

Everyone is expected to follow the [Typelevel Code of Conduct] when discussing the project on the available communication channels.


## Moderation

If you have any questions, concerns, or moderation requests, please contact a member of the [Typelevel Code of Conduct Committee].

[Typelevel Code of Conduct]: https://typelevel.org/code-of-conduct
[Typelevel Code of Conduct Committee]: https://typelevel.org/code-of-conduct#contact

If you would like to be an additionally point of contact for Code of Conduct reports, you can include your contact information in the Moderation section like so:

## Moderation

If you have any questions, concerns, or moderation requests, please contact a member of the [Typelevel Code of Conduct Committee] or reach out to a project moderator:

- [Your Name Here](mailto:moderator@example.org)

In the event of a Code of Conduct report, affiliate projects should follow the instructions outlined in the Enforcement Procedures Affiliate project processes section.

  • I acknowledge that this project must follow the Typelevel Code of Conduct
  • As an affiliate project, the CODE_OF_CONDUCT.md file can be found at here

Similarly, Typelevel projects must have an appropriate license, as specified in the Typelevel Charter.
Please make sure that the project's license is on the approved list.

  • This project's license can be found at here
Additional Notes

While Spire is the industry standard for generic numeric abstractions in Scala, our project (Number) occupies a distinct niche by addressing several specialized engineering and scientific requirements that are outside Spire's primary scope.
First, a central pillar of the project is maintaining numerical exactness through lazy evaluation. The primary purpose of our lazy evaluation mechanism is to preserve absolute precision for as long as possible. Unlike libraries that rely on immediate floating-point approximation, Number stores most numeric quantities—including irrational constants like π, e, and φ (the golden ratio)—as exact symbolic values. Consequently, derived quantities, such as angular measures in multiples of π, remain perfectly exact throughout calculations until explicit materialization is required.
Second, we implement a first-class probabilistic fuzzy arithmetic system. For modeling real-world measurements and their associated errors, values are treated as probability distributions (e.g., Gaussian or Bounded), enabling automatic uncertainty propagation through complex calculations.
Third, we provide a symbolic expression engine with a rule-based simplification system, supporting transcendental functions and algebraic reductions typically found in Computer Algebra Systems (CAS).
Fourth, our library features a type-safe dimensional analysis module for SI units, utilizing type-level rational exponents to enforce physical laws at compile time.
Crucially, Number is designed to complement the Typelevel ecosystem. We provide Cats instances (such as Order, Eq, and Show) for our core algebraic types, and our internal design is built upon rigorous functional principles. This ensures that our specialized numeric types—whether they are exact, fuzzy, or dimensioned—can be seamlessly integrated into functional programming pipelines. In essence, while Spire provides the foundation for algebraic types, Number extends these concepts into the domains of symbolic exactness, uncertainty modeling, and physical reality.

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 reviewing the Typelevel Charter and the linked CODE_OF_CONDUCT.md and LICENSE files for the proposed Number project. Check whether the affiliate-project criteria and required materials are satisfied; done means the Technical Steering Committee has enough information to decide on the project submission.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.