[Haskell-cafe] How to speedup generically parsing sum types?

Claus Reinke claus.reinke at talk21.com
Thu Nov 3 15:44:30 CET 2011


> * syb: toJSON and fromJSON from the Data.Aeson.Generic module. Uses
> the Data type class.
>..
> As can be seen, in most cases the GHC Generics implementation is much
> faster than SYB and just as fast as TH. I'm impressed by how well GHC
> optimizes the code!

Not that it matters much if you're going with other tools, but your 
SYB code has a long linear chain of type rep comparisons, at every
level of the recursive traversals. That is partially inherent in the SYB
design (reducing everything to cast), but could probably be improved?

Claus

 



More information about the Haskell-Cafe mailing list