[Haskell-cafe] Figuring out if an algebraic type is enumerated through Data.Generics?

Alfonso Acosta alfonso.acosta at gmail.com
Wed May 7 13:09:00 EDT 2008


On Wed, May 7, 2008 at 7:47 AM, Jules Bean <jules at jellybean.co.uk> wrote:
> Alfonso Acosta wrote:
>
> > It would certainly be difficult map any Haskell type to VHDL, so, by
> > now we would be content to map enumerate algebraic types (i.e.
> >  algebraic types whose all data constructors have arity zero, e.g.
> > data Colors = Green | Blue | Red)
> >
>
>  Wouldn't it be much simpler to use the standard deriveable classes Bounded
> and Enum, instead of an admittedly very clever trick using Data?

No, for the reasons explained in the probably_unnnecesary_background I
don't see how those instantiations would help.


More information about the Haskell-Cafe mailing list