<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 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.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-GB;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@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="margin-left:36.0pt">I suppose we want an instance<br>
forall k. instance Typeable (k -&gt; *) (Proxy k)<br>
<br>
<span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Yes, that looks right.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt">So the universally quantified kind variables of the tycon should end up universally<br>
quantified in the instance as well. How does this translate to the ds_tvs, ds_tys, and<br>
ds_tc_args arguments of a DerivSpec<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">My instinct is that the ds_tvs include both type and kind variables, kind variables first.&nbsp; The kinds of the type variables can mention the kind variables.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">The ds_tys field shoud include kind arguments as well as type arguments.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Does that work?<br>
<br>
Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</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 #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> josepedromagalhaes@gmail.com [mailto:josepedromagalhaes@gmail.com]
<b>On Behalf Of </b>José Pedro Magalhães<br>
<b>Sent:</b> 19 February 2013 10:04<br>
<b>To:</b> ghc-devs@haskell.org; Simon Peyton-Jones<br>
<b>Subject:</b> Fwd: [GHC] #7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Simon,<br>
<br>
How should an instance of Typeable for a polykinded tycon look like? E.g. if we have<br>
<br>
data Proxy (a :: k) = Proxy<br>
-- Proxy :: forall (k :: BOX). k -&gt; *<br>
<br>
I suppose we want an instance<br>
<br>
forall k. instance Typeable (k -&gt; *) (Proxy k)<br>
<br>
Right? So the universally quantified kind variables of the tycon should end up universally<br>
quantified in the instance as well. How does this translate to the ds_tvs, ds_tys, and<br>
ds_tc_args arguments of a DerivSpec?...<br>
<br>
<br>
Thanks,<br>
Pedro<o:p></o:p></p>
<div>
<p class="MsoNormal">---------- Forwarded message ----------<br>
From: <b>GHC</b> &lt;<a href="mailto:cvs-ghc@haskell.org">cvs-ghc@haskell.org</a>&gt;<br>
Date: Mon, Feb 18, 2013 at 8:42 PM<br>
Subject: [GHC] #7704: Phantom types break new polykind Typeable with either StandaloneDeriving or AutoDeriveTypeable<br>
To: <br>
Cc: <a href="mailto:ghc-tickets@haskell.org">ghc-tickets@haskell.org</a><br>
<br>
<br>
#7704: Phantom types break new polykind Typeable with either StandaloneDeriving or<br>
AutoDeriveTypeable<br>
-----------------------------&#43;----------------------------------------------<br>
Reporter: &nbsp;nwf &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Owner:<br>
&nbsp; &nbsp; Type: &nbsp;bug &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; Status: &nbsp;new<br>
Priority: &nbsp;normal &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;Component: &nbsp;Compiler<br>
&nbsp;Version: &nbsp;7.7 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; Keywords:<br>
&nbsp; &nbsp; &nbsp; Os: &nbsp;Unknown/Multiple &nbsp;| &nbsp; Architecture: &nbsp;Unknown/Multiple<br>
&nbsp;Failure: &nbsp;None/Unknown &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp;Blockedby:<br>
Blocking: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp;Related:<br>
-----------------------------&#43;----------------------------------------------<br>
&nbsp;This test program, reduced from an attempt to bring ekmett's tagged<br>
&nbsp;package to HEAD,<br>
&nbsp;{{{<br>
&nbsp;{-# LANGUAGE DeriveDataTypeable #-}<br>
&nbsp;{-# LANGUAGE PolyKinds #-}<br>
&nbsp;{-# LANGUAGE AutoDeriveTypeable #-}<br>
<br>
&nbsp;newtype Tagged s b = Tagged { unTagged :: b }<br>
&nbsp;}}}<br>
&nbsp;results in<br>
&nbsp;{{{<br>
&nbsp;GHCi, version 7.7.20130218: <a href="http://www.haskell.org/ghc/" target="_blank">
http://www.haskell.org/ghc/</a> &nbsp;:? for help<br>
&nbsp;Loading package ghc-prim ... linking ... done.<br>
&nbsp;Loading package integer-gmp ... linking ... done.<br>
&nbsp;Loading package base ... linking ... done.<br>
&nbsp;[1 of 1] Compiling Main &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( typeable.hs, interpreted )<br>
<br>
&nbsp;typeable.hs:5:1:<br>
&nbsp; &nbsp; &nbsp;Derived typeable instance must be of form (Typeable Tagged)<br>
&nbsp; &nbsp; &nbsp;In the stand-alone deriving instance for<br>
&nbsp; &nbsp; &nbsp; &nbsp;`Data.Typeable.Internal.Typeable Tagged'<br>
&nbsp;}}}<br>
<br>
&nbsp;This message is also emitted if I replace `AutoDeriveTypeable`<br>
&nbsp;`StandaloneDeriving` and `deriving instance Typeable Tagged`.<br>
<br>
&nbsp;However, a &quot;deriving (Typeable)&quot; clause on the newtype definition works<br>
&nbsp;just fine.<br>
<span style="color:#888888"><br>
<span class="hoenzb">--</span><br>
<span class="hoenzb">Ticket URL: &lt;<a href="http://hackage.haskell.org/trac/ghc/ticket/7704" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/7704</a>&gt;</span><br>
<span class="hoenzb">GHC &lt;<a href="http://www.haskell.org/ghc/" target="_blank">http://www.haskell.org/ghc/</a>&gt;</span><br>
<span class="hoenzb">The Glasgow Haskell Compiler</span><br>
<br>
<span class="hoenzb">_______________________________________________</span><br>
<span class="hoenzb">ghc-tickets mailing list</span><br>
<span class="hoenzb"><a href="mailto:ghc-tickets@haskell.org">ghc-tickets@haskell.org</a></span><br>
<span class="hoenzb"><a href="http://www.haskell.org/mailman/listinfo/ghc-tickets" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-tickets</a></span></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</body>
</html>