ValueOf typeclass to inhabit singleton types
See original GitHub issueCurrently there is no way to obtain the runtime value corresponding to a singleton type. SIP-23 - Literal-based singleton types mentions a ValueOf
(or SingleInhabitant
) type class that is currently missing from Dotty.
For reference, a ValueOf
type class was implemented in Typelevel Scala in this commit:
https://github.com/typelevel/scala/commit/d777d40bbacec01f2f94531cd2db933f8c8cd4c9
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
SIP-23 - Literal-based singleton types - Scala Documentation
ValueOf [T] type class and corresponding scala. Predef. valueOf[T] operator has been added yielding the unique value of types with a single inhabitant....
Read more >Dependently typed programming with singletons
Therefore, singleton types are necessary to express the dependency between values and types. These singleton types introduce overhead and ...
Read more >Introduction to Singletons (Part 2) - in Code
First, this derives the type DoorState with the values Opened , Closed , and Locked , and also the kind DoorState with the...
Read more >Type Classes - Theorem Proving in Lean 4
What makes type class inference powerful is that one can chain instances. ... You can view the parameter of the type class Inhabited...
Read more >Data.Singletons.TH - Hackage
This module contains basic functionality for deriving your own singletons via ... If a :~: b is inhabited by some terminating value, then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll pick this up if nobody else wants it.
Edit: comment moved to https://github.com/lampepfl/dotty-feature-requests/issues/172#issuecomment-773308156