question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueOf typeclass to inhabit singleton types

See original GitHub issue

Currently 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:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
milessabincommented, Dec 18, 2018

I’ll pick this up if nobody else wants it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found