Figuring out if an algebraic type is enumerated through Data.Generics?

Hi all,

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? Metaprogramming comes in many shapes and sizes, and even the humble deriving (Show,Enum,Bounded,Ord,Eq) gives you quite some leverage.. Jules

On Wed, May 7, 2008 at 7:47 AM, Jules Bean
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.
participants (2)
-
Alfonso Acosta
-
Jules Bean