<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.Code, li.Code, div.Code
        {mso-style-name:Code;
        mso-style-link:"Code Char";
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Courier New";
        color:#1F497D;}
span.CodeChar
        {mso-style-name:"Code Char";
        mso-style-link:Code;
        font-family:"Courier New";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
.MsoPapDefault
        {mso-style-type:export-only;
        margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:0cm;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:36.0pt">
It seems to be a fairly popular proposal. =)<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Indeed.  Ben Price (now at Strathclyde) did a short internship at MSR working on this; see<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">               
<a href="https://ghc.haskell.org/trac/ghc/wiki/TypeableT">https://ghc.haskell.org/trac/ghc/wiki/TypeableT</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Dimitrios, Stephanie, Richard, and I are working on a paper about it, which should be out in a couple of weeks.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">At that point we’ll be in a position to have a proper core-libraries-committee discussion about the right API etc; I hope we can make
 the result part of GHC 8.0. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">But I want to get the paper out first since it gives a reasonably articulate exposition of the ideas and rationale, so that we all
 start on the same page.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Libraries [mailto:libraries-bounces@haskell.org]
<b>On Behalf Of </b>Edward Kmett<br>
<b>Sent:</b> 29 September 2015 16:53<br>
<b>To:</b> Roman Cheplyaka<br>
<b>Cc:</b> Haskell Libraries<br>
<b>Subject:</b> Re: Can we simplify Dynamic?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
It seems to be a fairly popular proposal. =)<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fmail.haskell.org%2fpipermail%2flibraries%2f2014-August%2f023633.html&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c4a20632c14424882676b08d2c8e5fe0e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=Q8v9rdZ4Q%2bnw7oER7kBQb42HIXiujZOEmkO%2fQPOqe0g%3d">https://mail.haskell.org/pipermail/libraries/2014-August/023633.html</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
-Edward<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<o:p> </o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
On Mon, Sep 28, 2015 at 6:03 PM, Roman Cheplyaka <<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
I suggested this last year, see this thread<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fmail.haskell.org%2fpipermail%2flibraries%2f2014-March%2f022287.html&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c4a20632c14424882676b08d2c8e5fe0e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=NllZIb67%2fxgH1fNXfMJ5nsgWm%2bwRpfXEBWt4kPlS9AM%3d" target="_blank">https://mail.haskell.org/pipermail/libraries/2014-March/022287.html</a><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
<br>
On 09/29/2015 12:51 AM, David Feuer wrote:<br>
> Currently,<br>
><br>
> data Dynamic = Dynamic TypeRep Obj<br>
>                deriving Typeable<br>
> where<br>
> type Obj = Any<br>
><br>
> As a result, all of the operations must be implemented "by hand" using<br>
> unsafeCoerce. The more obvious representation these days would seem to be<br>
><br>
> data Dynamic where<br>
>   Dynamic :: Typeable a => a -> Dynamic<br>
><br>
> Most of the operations then become trivial applications of Typeable<br>
> functions.    The only exceptions seem to be  dynApply and dynApp. That<br>
> there are exceptions strikes me as quite unfortunate. The easiest fix is<br>
> inspired by the fact that Data.Dynamic uses<br>
><br>
> funResultTy :: TypeRep -> TypeRep -> Maybe TypeRep<br>
><br>
> from Data.Typeable to decide whether to coerce. It seems reasonable to<br>
> add a more informative version, something like<br>
><br>
> applyTypeable :: (Typeable f, Typeable a) =><br>
>    proxy f -><br>
>    proxy a -><br>
>    (forall b . (Typeable b, f ~ (a -> b)) => r) -><br>
>    Maybe r<br>
><br>
> On the other hand, it would be really cool if there were some more<br>
> general way to get type-level information out of Typeable instances,<br>
> pattern matching on the type constructors.<br>
<br>
<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskell.org%2fcgi-bin%2fmailman%2flistinfo%2flibraries&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c4a20632c14424882676b08d2c8e5fe0e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=Yb6xCqACYgr8gw%2ffKgyGvWooH2vs1S6kriYtUAV8LQg%3d" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>