[Haskell-cafe] Typeable typeclass and type-level naturals

José Pedro Magalhães jpm at cs.uu.nl
Wed Jun 5 09:49:09 CEST 2013


On Wed, Jun 5, 2013 at 8:46 AM, Roman Cheplyaka <roma at ro-che.info> wrote:

> * TP <paratribulations at free.fr> [2013-06-05 00:37:36+0200]
> > Roman Cheplyaka wrote:
> >
> > > Try adding
> > >
> > >   deriving instance Typeable 'Zero
> > >   deriving instance Typeable a => Typeable ('Succ a)
> > >
> > > to your module.
> > >
> > > (I haven't tested it -- you might need to tweak it a bit.)
> >
> > Thanks Roman.
> > Unfortunately, I already tried that (without the constraint "Typeable a
> =>",
> > what a fool), but it did not work. The error is the same with the
> > constraint:
> >
> >     Derived typeable instance must be of form (Typeable 'Succ)
> >     In the stand-alone deriving instance for
> >       'Typeable a => Typeable (Succ a)'
> >
> > What is the problem?
>
> Oh, it should probably be simply
>
>   deriving instance Typeable 'Zero
>   deriving instance Typeable 'Succ
>

Yes, that's how it should be. Please let me know if that
doesn't work.

(Sorry for taking so long to reply to this...)


Cheers,
Pedro


>
> Roman
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130605/3dc91562/attachment-0001.htm>


More information about the Haskell-Cafe mailing list