Henry,

Ah, pressed send way to early. Of course, the definition should change a little as well:

 convert :: Data a => Int -> a
 convert i = x    where
     x = fromConstr ( dataTypeConstrs (dataTypeOf x) !! (i - 1) )

Cheers,

  Stefan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to