fthomas / fthomas/refined

Compile-time refinement for cons

Open
#575 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Scala
Stars
1.7k
Forks
152
Avg merge
1h 20m
Merged PRs (30d)
6

Description

It would be cool if this worked:

```scala
type NonEmptySeq[A] = immutable.Seq[A] Refined NonEmpty

object NonEmptySeq {
def apply[A]: RefinedTypeOps[NonEmptySeq[A], immutable.Seq[A]] = {
new RefinedTypeOps[NonEmptySeq[A], immutable.Seq[A]]
}
}

val a = "refined"
val b = "types" :: "are" :: "cool!"
NonEmptySeq[String](a :: b)
// or at least
NonEmptySeq[String](::(a, b))
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing RefinedTypeOps and the NonEmpty refinement used in the example. Done means determining whether the shown NonEmptySeq calls, including the alternative :: form, can compile-time refine a non-empty sequence and documenting or implementing the supported scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers
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.