<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 -> *) (Proxy k)<br>
<br>
<span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1F497D">Yes, that looks right.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1F497D"><o:p> </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> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1F497D">My instinct is that the ds_tvs include both type and kind variables, kind variables first. 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:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";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:"Verdana","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";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:"Verdana","sans-serif";color:#1F497D"><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 #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> 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> </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 -> *<br>
<br>
I suppose we want an instance<br>
<br>
forall k. instance Typeable (k -> *) (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> <<a href="mailto:cvs-ghc@haskell.org">cvs-ghc@haskell.org</a>><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>
-----------------------------+----------------------------------------------<br>
Reporter: nwf | Owner:<br>
Type: bug | Status: new<br>
Priority: normal | Component: Compiler<br>
Version: 7.7 | Keywords:<br>
Os: Unknown/Multiple | Architecture: Unknown/Multiple<br>
Failure: None/Unknown | Blockedby:<br>
Blocking: | Related:<br>
-----------------------------+----------------------------------------------<br>
This test program, reduced from an attempt to bring ekmett's tagged<br>
package to HEAD,<br>
{{{<br>
{-# LANGUAGE DeriveDataTypeable #-}<br>
{-# LANGUAGE PolyKinds #-}<br>
{-# LANGUAGE AutoDeriveTypeable #-}<br>
<br>
newtype Tagged s b = Tagged { unTagged :: b }<br>
}}}<br>
results in<br>
{{{<br>
GHCi, version 7.7.20130218: <a href="http://www.haskell.org/ghc/" target="_blank">
http://www.haskell.org/ghc/</a> :? for help<br>
Loading package ghc-prim ... linking ... done.<br>
Loading package integer-gmp ... linking ... done.<br>
Loading package base ... linking ... done.<br>
[1 of 1] Compiling Main ( typeable.hs, interpreted )<br>
<br>
typeable.hs:5:1:<br>
Derived typeable instance must be of form (Typeable Tagged)<br>
In the stand-alone deriving instance for<br>
`Data.Typeable.Internal.Typeable Tagged'<br>
}}}<br>
<br>
This message is also emitted if I replace `AutoDeriveTypeable`<br>
`StandaloneDeriving` and `deriving instance Typeable Tagged`.<br>
<br>
However, a "deriving (Typeable)" clause on the newtype definition works<br>
just fine.<br>
<span style="color:#888888"><br>
<span class="hoenzb">--</span><br>
<span class="hoenzb">Ticket URL: <<a href="http://hackage.haskell.org/trac/ghc/ticket/7704" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/7704</a>></span><br>
<span class="hoenzb">GHC <<a href="http://www.haskell.org/ghc/" target="_blank">http://www.haskell.org/ghc/</a>></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> </o:p></p>
</div>
</div>
</body>
</html>