<div dir="ltr">i assume 7.6 and 7.8, if we're talking GHC rather than GCC :)<div><br></div><div>in 7.8 you can't define userland typeable instances, you need only write deriving (Typeable) and you're all set. </div>

<div>add some CPP to select the instances suitable</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 12:41 PM, Volker Wysk <span dir="ltr"><<a href="mailto:verteiler@volker-wysk.de" target="_blank">verteiler@volker-wysk.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'DejaVu Sans';font-size:13pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">Hi!<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">I've been working with GHC-4.6.3, and updating to GHC-4.8.3 breaks my code, </span></p>


<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">because the Typeable class has been changed. The compiler produces this </span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">message:<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">---------</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">src/HsShellScript/ProcErr.chs:2294:4:</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">    ‘typeOf’ is not a (visible) method of class ‘Typeable’</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">---------<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">I want to define System.Posix.Process.ProcessStatus to be an instance of </span></p>


<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">Typeable, so I can throw and catch it as an exception. ProcessStatus isn't </span></p>


<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">typeable by default.<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">Is it still possible to make ProcessStatus a member of Typeable? How? </span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">Obviously, you can't accomplish it by deriving Typeable, because the definition </span></p>


<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">can't be changed any longer.<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">This is the spot in question:<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">----------</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">import System.Posix.Process</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">import Data.Typeable<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">{-</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">data ProcessStatus = Exited ExitCode</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;font-style:italic;color:#008000">                   | Terminated Signal</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;font-style:italic;color:#008000">                   | Stopped Signal</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">                   deriving (Eq, Ord, Show)</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">-}<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">instance Typeable ProcessStatus where</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">   typeOf = const tyCon_ProcessStatus<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">tyCon_ProcessStatus = mkTyConApp (mkTyCon3 "hsshellscript"</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">                                           "HsShellScript.ProcErr"</span></p>


<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">                                           "Posix.ProcessStatus") []<br></span></p>


<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">instance Exception ProcessStatus</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">----------<br></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">Thanks,</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-size:17px;color:#1f1c1b">V.W.</span></p></div><br>_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
<br></blockquote></div><br></div>