loading...

Template Haskell vs GHC.Generic

louy2 profile image Yufan Lou ・1 min read

WARNING: This is not from experience, all hearsay.

Template Haskell

Pros

  • Relatively fast compile time
  • Guaranteed no runtime overhead

Cons

  • Source order dependent
  • Weakly typed (AST to AST)

GHC.Generic

Pros

  • Source order independent like all other Haskell source
  • Strongly typed

Cons

  • Slow compile time
  • May not be fully optimized away

Discussion

pic
Editor guide