fthomas/refined
Refinement types for Scala observed · 2026-08-28
Health v2 · maintenance only
85/100
- Activity 99
- Release rhythm 58
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 549
- age_days: 4133
- days_rel: 64
- days_push: 10
- n_releases_24m: 2
Adoption not part of the score
1733 stars · 153 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
refined is a Scala library for refinement types, letting you attach type-level predicates to base types so value constraints are checked at compile time (for literals) or runtime (for arbitrary values). It is a port of the Haskell refined library and includes inference rules for converting between compatible refined types.
Use cases
- enforce that an Int is positive at compile time
- validate runtime values against predicates and get Either results
- constrain string values like non-empty or matching a regex via types
- convert between refined types when predicates imply each other
- catch invalid domain values as compile errors instead of runtime bugs
When to choose
- you write Scala and want value constraints encoded in types
- you want compile-time validation of literals and safe conversions between constrained types
- you prefer typelevel-style functional programming idioms
When to avoid
- you work outside the Scala/JVM ecosystem
- your team finds type-level predicates too complex for the codebase
- you need validation in dynamically typed languages
Facets
library · maturity active
type-system form-handling programming-languages developer-tools jvm refinement-types typelevel scala compile-time-validation type-safety
1 source
- readme: https://github.com/fthomas/refined · fetched 2026-08-28 · 942373dcd846
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| fthomas/refined | main | 85 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem