singletons stuff in GHC.Generics?

Ben Gamari ben at well-typed.com
Wed Mar 30 19:46:22 UTC 2016


Carter Schonwald <carter.schonwald at gmail.com> writes:

> Hey All, i just noticed that theres some Singletons code in the
> GHC.Generics module thats defined but not exported, whats the context on
> that?
>
It's used strictly internally in instances defined in GHC.Generics. For
instance,

    instance (KnownSymbol n, SingI f, SingI r)
        => Constructor ('MetaCons n f r) where
      conName     _ = symbolVal (Proxy :: Proxy n)
      conFixity   _ = fromSing  (sing  :: Sing f)
      conIsRecord _ = fromSing  (sing  :: Sing r)

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160330/3ef373ea/attachment.sig>


More information about the ghc-devs mailing list