vic/typeset
{ "defaultBranch": "main", "description": "An Scala type-indexed set, checked at compile time.", "fullName": "vic/typeset", "homepage": "", "language": "Scala", "name": "typeset", "pushedAt": "2025-07-15T04:35:58Z", "stargazersCount": 1, "updatedAt": "2025-07-15T04:36:02Z", "url": "https://github.com/vic/typeset"}typeset 
Section titled “typeset ”An Scala Type indexed set checked at compile time.
a TypeSet is similar to ZIO’s Has[_] type but without any reflection need.
Adding to your project.
Section titled “Adding to your project.”Jars are available for all versions and commits at Jitpack.io.
Creating a TypeSet is always done by prepending something to TNil, which
represent the empty TypeSet.
import typeset.*
val x = "Hello" :+: TNilOf course, being a Set, you can’t duplicate types of values on it.
// val bad = "Hello" :+: "World" :+: TNil // This wont compile!!The type of the set can be re-arrenged on the left side and any combination containing the same types should be valid.
val a: String :+: Boolean :+: Int :+: TNil = "Hello" :+: true :+: 42 :+: TNilval b: Int :+: String :+: Boolean :+: TNil = a // types are the same.TypeSets can be joined together if they contained types do not cause duplicates.
val a = 1 :+: TNilval b = true :+: TNilval c = a :+: b // Has type Int :+: Boolean :+: TNilOnce created, you can obtain the value of a type from a Set.
val a = true :+: "Hello" :+: TNilval x: String = a.get[String] // Returns "Hello"Removing a type returns it’s current value and another collapsed set without the type present.
val a = true :+: "Hello" :+: TNilval (x: String, b) = a.drop[String]!() // type of b is Boolean :+: TNilThat’s pretty much it. For more examples you can see the [test code]!(typeset/test/src).
Contributing
Section titled “Contributing”All contributions are welcome, just please be kind and repectful of other people’s time.
For Building, you will need mill installed.
mill __.test # This will run all tests