News for hackers. Stuff that matters.
Re:Some Notes About How I Write Haskell by harpocrates on Wednesday February 21, 2018 @01:23PM (#16431627)
> People underestimate the compiler cost of deriving instances. It adds up very fast if you derive lots of functors and foldables in your quest for unique names everywhere.

Do you pay this price when you derive via a `newtype`? Or does GHC figure out that the instance it would write out would be identical (modulo coercions)?

Re:Some Notes About How I Write Haskell by acomar on Wednesday February 21, 2018 @05:19PM (#16433497)
It can generate the instance for you for particular typeclasses with an extension. See DeriveGeneric and DeriveAnyClass. The penalty applies when you're unwilling to use these extensions or when you create a type with the `data` keyword.