是否有从单例中提取值的函数?

Is there a function to extract a value from a Singleton?

我正在开发一种需要 SNat 的数据类型,并且希望能够为用户提供 Nat。在 Hoogle 上搜索尚未产生结果。

即有没有函数

f :: forall a (x :: a). Sing a x -> a

?

您可以使用 singletons

中的 fromSing