Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code to convert from representation types, to existentially quant…
…ified singletons. The basic idea is like this: data SomeSing where SomeSing :: SingI n => Proxy n -> SomeSing toSing :: Integer -> Maybe SomeSing -- Maybe, so that we rejetc -ve numbers The actual implementation is a bit more complicated because `SomeSing` is actually parameterized by a kind, so we really have something akin `SomeSing k`. Also, `toSing` is a bit more general because, depending on the kind, the representation is different. For example, we also support: toSing :: String -> Maybe (SomeSing (KindParam :: KindIs Symbol)) This change relies on the primitive added to the compiler, which converts `Sing` values into `SingI` dictionaries. A nice benefit of this change is that, as far as I can see, we don't need `unsafeSinNat` and friends, so I removed them.
- Loading branch information
Iavor S. Diatchki
authored and
Iavor S. Diatchki
committed
May 27, 2013
1 parent
d6b6a0a
commit f7fb908
Showing
1 changed file
with
94 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters