[Haskell-cafe] Deriving

Daryoush Mehrtash dmehrtash at gmail.com
Tue Dec 2 17:11:53 EST 2008


What happens when a type adds driving such as:

newtype SupplyT s m a = SupplyT (StateT [s] m a)
    deriving (Functor
<http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Functor>,
Monad <http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Monad>,
MonadTrans, MonadIO)


Two questions:

How does the deriving implement the instance?

Is there a way for me to add  my own classes in the deriving?  for example

newtype .....
   deriving( xyz)


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081202/da53dbd1/attachment.htm


More information about the Haskell-Cafe mailing list