It would be interesting to see when you HAVE to use dynamics, e.g. when no other solution is possible in Haskell...<div><br></div><div>Right now if I use it, it feels that I&#39;m doing so because I&#39;m too new to Haskell.</div>
<div><br></div><div><div><div><br><div class="gmail_quote">On Thu, Feb 12, 2009 at 7:53 PM, Lennart Augustsson <span dir="ltr">&lt;<a href="mailto:lennart@augustsson.net">lennart@augustsson.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You&#39;re quite right. &nbsp;You should only be allowed to derive Typeable.<br>
(Which could be arranged by hiding the methods of typeable.)<br>
<div><div></div><div class="Wj3C7c"><br>
On Thu, Feb 12, 2009 at 6:24 PM, Jonathan Cast<br>
&lt;<a href="mailto:jonathanccast@fastmail.fm">jonathanccast@fastmail.fm</a>&gt; wrote:<br>
&gt; On Thu, 2009-02-12 at 19:04 +0100, Lennart Augustsson wrote:<br>
&gt;&gt; They are not unsafe in the way unsafePerformIO is,<br>
&gt;<br>
&gt; I beg permission to demur:<br>
&gt;<br>
&gt; &nbsp;newtype Unsafe alpha = Unsafe { unUnsafe :: alpha }<br>
&gt; &nbsp;instance Typeable (Unsafe alpha) where<br>
&gt; &nbsp; &nbsp;typeOf _ = typeOf ()<br>
&gt;<br>
&gt; &nbsp;pseudoSafeCoerce :: alpha -&gt; Maybe beta<br>
&gt; &nbsp;pseudoSafeCoerce = fmap unUnsafe . cast . Unsafe<br>
&gt;<br>
&gt; Note that<br>
&gt;<br>
&gt; &nbsp;pseudoSafeCoerce = Just . unsafeCoerce<br>
&gt;<br>
&gt;&gt; but I regard them<br>
&gt;&gt; as a last resort in certain situations.<br>
&gt;&gt; Still, in those situations they are very useful.<br>
&gt;<br>
&gt; But I would agree with both of these. &nbsp;As long as you *derive* Typeable.<br>
&gt;<br>
&gt; jcc<br>
&gt;<br>
&gt;<br>
</div></div><div><div></div><div class="Wj3C7c">&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div></div></div>