DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Yufan Lou
Yufan Lou

Posted on

Template Haskell vs GHC.Generic

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

Top comments (0)

πŸ‘‹ Welcome new DEV members in our Welcome Thread

Say hello to the newest members of DEV.