Haskell's GeneralizedNewtypeDeriving mechanism is great; for those who haven't seen it, writing something like
newtype SkewOptT α = SkewOptT (StateT Bool α)
deriving (Applicative, Functor, Monad, MonadTrans)
will automatically generate instances like,
instance [overlap ok] Monad => Monad (SkewOptT )
However, for one of my typeclasses, I want to customize a few methods. Is there a way to override, or disable what GeneralizedNewtypeDeriving does for these methods? The typeclass encodes some basic DSL instructions, like for
(a loop), parfor
(a parallel loop), fcndef
(add a new function), etc., and there isn't a perfect way to split it up into multiple typeclasses [and then automatically derive one, and manually write the other].