Open uzytkownik opened 3 years ago
Can you extract a KnownNat
witness from a singletons
-style Nat
singleton? I would expect that to be the biggest hurdle.
@gergoerdi Yes. The definitions are almost exactly the same:
data SNat (n :: Nat) = KnownNat n => SNat
type instance Sing = SNat
data SNat (n :: Nat) where
SNat :: KnownNat n => SNat n
It doesn’t have a Lift instance though
singletons
already depends on template-haskell
, so perhaps the maintainers would accept a PR?
singletons library is already in dependencies of clash. However clash uses own
SNat
implementation. That means that code using singletons needs to convert back and forth between them.