Auto generated instance codes through 'deriving'

Simon Peyton-Jones simonpj@microsoft.com
Fri, 7 Feb 2003 08:41:09 -0000


This is a multi-part message in MIME format.

--------------InterScan_NT_MIME_Boundary
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C2CE84.A975E34C"

------_=_NextPart_001_01C2CE84.A975E34C
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Try -ddump-deriv

=20
http://haskell.cs.yale.edu/ghc/docs/latest/html/users_guide/options-debu
gging.html#DUMPING-OUTPUT

=20

Simon

=20

-----Original Message-----
From: Jong Keun Na [mailto:jongkn@microsoft.com]=20
Sent: 07 February 2003 06:15
To: haskell-cafe@haskell.org
Subject: Auto generated instance codes through 'deriving'

=20

Hello folks,

Is there any method with which I can see instance's codes generated
automatically by using 'deriving' keyword in GHC?

I'm curious in how GHC generates 'Read' class's instance code for
user-defined data type.

Any help will be great appreciated.

/JongKeun


------_=_NextPart_001_01C2CE84.A975E34C
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">




<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<title>Auto generated instance codes through 'deriving'</title>

<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	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";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
p
	{margin-right:0cm;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman";}
span.EmailStyle18
	{font-family:Arial;
	color:navy;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-GB link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><!-- Converted from text/rtf format =
-->Try
-ddump-deriv</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
http://haskell.cs.yale.edu/ghc/docs/latest/html/users_guide/options-debug=
ging.html#DUMPING-OUTPUT</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
 10.0pt;font-family:Arial;color:navy'>Simon</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<div style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm 0cm =
0cm 4.0pt'>

<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> </span></font><font =
size=3D2
  face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>Jong</span></font><font
 size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>
 </span></font><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;
  font-family:Tahoma'>Keun</span></font><font size=3D2 =
face=3DTahoma><span
lang=3DEN-US style=3D'font-size:10.0pt;font-family:Tahoma'> Na
[mailto:jongkn@microsoft.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> </span></font><font =
size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>07
 February 2003</span></font><font size=3D2 face=3DTahoma><span =
lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Tahoma'> </span></font><font
 size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>06:15</span></font><font
size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'><br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
haskell-cafe@haskell.org<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Auto generated =
instance
codes through 'deriving'</span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&nbsp;</span></font></p>

<p><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;
font-family:Tahoma'>Hello folks,</span></font></p>

<p><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;
font-family:Tahoma'>Is there any method</span></font><span lang=3DEN-US> =
</span><font
size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>with
which I can see</span></font><span lang=3DEN-US> </span><font size=3D2 =
face=3DTahoma><span
lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>instance&#8217;s</span></fo=
nt><span
lang=3DEN-US> </span><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'>codes</span></font><span lang=3DEN-US> =
</span><font
size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>generated
automatically</span></font><span lang=3DEN-US> </span><font size=3D2 =
face=3DTahoma><span
lang=3DEN-US style=3D'font-size:10.0pt;font-family:Tahoma'>by =
using</span></font><span
lang=3DEN-US> </span><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'>&#8216;<b><span =
style=3D'font-weight:bold'>deriving&#8217;</span></b>
keyword in GHC?</span></font></p>

<p><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;
font-family:Tahoma'>I&#8217;m curious in how GHC =
generates</span></font><span
lang=3DEN-US> </span><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'>&#8216;<b><span =
style=3D'font-weight:bold'>Read&#8217;</span></b></span></font><span
lang=3DEN-US> </span><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'>class&#8217;s</span></font><span =
lang=3DEN-US> </span><font
size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>instance
code for</span></font><span lang=3DEN-US> </span><font size=3D2 =
face=3DTahoma><span
lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>user-defined</span></font><=
span
lang=3DEN-US> </span><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'>data type.</span></font></p>

<p><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;
font-family:Tahoma'>Any</span></font><span lang=3DEN-US> </span><font =
size=3D2
face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>help
will be</span></font><span lang=3DEN-US> </span><font size=3D2 =
face=3DTahoma><span
lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Tahoma'>great</span></font><span
lang=3DEN-US> </span><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Tahoma'>appreciated.</span></font></p>

<p><font size=3D2 face=3DTahoma><span lang=3DEN-US =
style=3D'font-size:10.0pt;
font-family:Tahoma'>/JongKeun</span></font></p>

</div>

</div>

</body>

</html>

------_=_NextPart_001_01C2CE84.A975E34C--

--------------InterScan_NT_MIME_Boundary--