<div dir="ltr"><div><div><br></div>I could also do my own MonadError class also, no?<br></div>However this doesn't work:<br><br><span style="font-family:monospace,monospace"><br></span><div><span style="font-family:monospace,monospace"> {-# LANGUAGE ConstraintKinds #-} <br><br>type EvError a = MonadError String a<br><br>class (Typeable n, Monad n, Applicative n, EvError n) => EvMgt n where ...<br><br></span><div><span style="font-family:monospace,monospace">instance EvMgt IO where...</span></div><br><div><div class="gmail_extra"><br></div><div class="gmail_extra">How can I create a new class "EvError" that inherits all the functions of "MonadError String"?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 15, 2016 at 12:24 AM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p dir="ltr">You can't do that; sorry. You can always turn a string into an IOException if you like. Or you could write a wrapper around IO. But MonadError has a functional dependency, so you can only have one error type per monad.</p>
<div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Jul 14, 2016 6:19 PM, "Corentin Dupont" <<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hello,<br></div>IO is an instance of MonadError IOException...<br></div>However I also need to make it an instance of MonadError String...<br></div>Is it possible?<br><div><div><div><div><div>I'm trying to instanciate this class:<br><span style="font-family:monospace,monospace"><br>class (Typeable n, Monad n, Applicative n, MonadError String n) => EvMgt n where ...<br><br></span></div><div><span style="font-family:monospace,monospace">instance EvMgt IO where...</span><br><br></div><div>Any idea?<br></div></div></div></div></div></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div>