<pre class="haskell"><span style="color: rgb(0, 0, 153);">What happens when a type adds driving such as:<br><br>newtype</span> SupplyT s m a = SupplyT <span style="color: black;">(</span>StateT <span style="color: black;">[</span>s<span style="color: black;">]</span> m a<span style="color: black;">)</span><br>
    <span style="color: rgb(0, 0, 153);">deriving</span> <span style="color: black;">(</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Functor"><span style="color: rgb(51, 0, 51);">Functor</span></a>, <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Monad"><span style="color: rgb(51, 0, 51);">Monad</span></a>, MonadTrans, MonadIO<span style="color: black;">)</span></pre>
<br>Two questions:<br><br>How does the deriving implement the instance?<br><br>Is there a way for me to add&nbsp; my own classes in the deriving?&nbsp; for example<br><br>newtype .....<br>&nbsp;&nbsp; deriving( xyz)<br><br><br>Thanks<br><br clear="all">
<br>