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.
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)?