<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Sad about Import Cycles &#8230;</title>
	<atom:link href="http://www.alsonkemp.com/haskell/sad-about-import-cycles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/</link>
	<description>Hackfoofery</description>
	<lastBuildDate>Thu, 28 Jan 2010 15:57:11 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: chris k</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-91</link>
		<dc:creator>chris k</dc:creator>
		<pubDate>Tue, 06 Jan 2009 16:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-91</guid>
		<description>&lt;p&gt;The haskell-src-exts package can now parse and produce the {-# SOURCE #-} pragmas and I am using it to generate Haskell code for a different project.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The haskell-src-exts package can now parse and produce the {-# SOURCE #-} pragmas and I am using it to generate Haskell code for a different project.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: alson</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-90</link>
		<dc:creator>alson</dc:creator>
		<pubDate>Mon, 05 Jan 2009 19:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-90</guid>
		<description>&lt;p&gt;maltem,&lt;/p&gt;

&lt;p&gt;&quot;hack-ish&quot; is just a grumpy way to say &quot;work-around-ish&quot; and .hs-boot is definitely &quot;work-around-ish&quot;.  I&#039;d love GHC to support Haskell98 in this area.&lt;/p&gt;

&lt;p&gt;A&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>maltem,</p>

<p>&#8220;hack-ish&#8221; is just a grumpy way to say &#8220;work-around-ish&#8221; and .hs-boot is definitely &#8220;work-around-ish&#8221;.  I&#8217;d love GHC to support Haskell98 in this area.</p>

<p>A</p>]]></content:encoded>
	</item>
	<item>
		<title>By: maltem</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-89</link>
		<dc:creator>maltem</dc:creator>
		<pubDate>Mon, 05 Jan 2009 18:53:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-89</guid>
		<description>&lt;p&gt;hs-boot files are just a way of doing some work that should actually be done by the compiler. It&#039;s awfully tedious, but it isn&#039;t hackish.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>hs-boot files are just a way of doing some work that should actually be done by the compiler. It&#8217;s awfully tedious, but it isn&#8217;t hackish.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: alson</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-84</link>
		<dc:creator>alson</dc:creator>
		<pubDate>Mon, 05 Jan 2009 06:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-84</guid>
		<description>&lt;p&gt;dmwit,&lt;/p&gt;

&lt;p&gt;I think that the .hs-boot thing has been supported for a while (also, I referenced that link at the top of my post).  I&#039;ve never been able to get the .hs-boot thing to work too well and I&#039;m really afraid to make it part of building Turbinado...  But maybe I should relax and see if I can get the code generator to generate the .hs-boot files.  It still feels awfully hack-ish, though.&lt;/p&gt;

&lt;p&gt;A&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>dmwit,</p>

<p>I think that the .hs-boot thing has been supported for a while (also, I referenced that link at the top of my post).  I&#8217;ve never been able to get the .hs-boot thing to work too well and I&#8217;m really afraid to make it part of building Turbinado&#8230;  But maybe I should relax and see if I can get the code generator to generate the .hs-boot files.  It still feels awfully hack-ish, though.</p>

<p>A</p>]]></content:encoded>
	</item>
	<item>
		<title>By: dmwit</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-81</link>
		<dc:creator>dmwit</dc:creator>
		<pubDate>Mon, 05 Jan 2009 05:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-81</guid>
		<description>&lt;p&gt;But, but... GHC supports recursive modules!  Take a look at the documentation on .hs-boot files:
http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#mutual-recursion&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>But, but&#8230; GHC supports recursive modules!  Take a look at the documentation on .hs-boot files:
<a href="http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#mutual-recursion" rel="nofollow">http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#mutual-recursion</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: alson</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-80</link>
		<dc:creator>alson</dc:creator>
		<pubDate>Mon, 05 Jan 2009 02:20:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-80</guid>
		<description>&lt;p&gt;Saizan,&lt;/p&gt;

&lt;p&gt;Funny.  I&#039;d had it in my mind that importing Types twice would be a problem, but it makes sense that it wouldn&#039;t be...&lt;/p&gt;

&lt;p&gt;... in which case, I&#039;m left with the problem that CommentModel requires functions from PageModel and PageModel requires functions from CommentModel ...&lt;/p&gt;

&lt;p&gt;... also, there&#039;s the problem with overlapping &quot;_id&quot; fields in Types.hs...&lt;/p&gt;

&lt;p&gt;A&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Saizan,</p>

<p>Funny.  I&#8217;d had it in my mind that importing Types twice would be a problem, but it makes sense that it wouldn&#8217;t be&#8230;</p>

<p>&#8230; in which case, I&#8217;m left with the problem that CommentModel requires functions from PageModel and PageModel requires functions from CommentModel &#8230;</p>

<p>&#8230; also, there&#8217;s the problem with overlapping &#8220;_id&#8221; fields in Types.hs&#8230;</p>

<p>A</p>]]></content:encoded>
	</item>
	<item>
		<title>By: alson</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-79</link>
		<dc:creator>alson</dc:creator>
		<pubDate>Mon, 05 Jan 2009 02:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-79</guid>
		<description>&lt;p&gt;Derek,&lt;/p&gt;

&lt;p&gt;Yeah, Haskell98 does require that.  I know it&#039;s a low priority, but it&#039;d be great if GHC supported that requirement, too...&lt;/p&gt;

&lt;p&gt;Neil,&lt;/p&gt;

&lt;p&gt;I just bumped into a nasty problem with using a single Types file.  My data types are generated from the database tables.  A lot of the tables have overlapping field names  (e.g. _id).  So Types.hs has something like:&lt;/p&gt;

&lt;p&gt;data Page    = Page {_id :: Int, ...}
data Comment = Comment {_id :: Int, ...}&lt;/p&gt;

&lt;p&gt;Since the field labels are just functions, GHC complains about _id being defined twice...  Doh.&lt;/p&gt;

&lt;p&gt;Christopher,&lt;/p&gt;

&lt;p&gt;That would separate like/related bits of code from each other.  I&#039;m kinda sad that a compiler issue is forcing me to organize my code into non-intuitive blocks...&lt;/p&gt;

&lt;p&gt;Victor,&lt;/p&gt;

&lt;p&gt;Doh!  As mentioned above, Types.hs won&#039;t work (because of multiply defined &quot;_id&quot;)...&lt;/p&gt;

&lt;p&gt;Argh...  This is getting ugly.&lt;/p&gt;

&lt;p&gt;Alson&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Derek,</p>

<p>Yeah, Haskell98 does require that.  I know it&#8217;s a low priority, but it&#8217;d be great if GHC supported that requirement, too&#8230;</p>

<p>Neil,</p>

<p>I just bumped into a nasty problem with using a single Types file.  My data types are generated from the database tables.  A lot of the tables have overlapping field names  (e.g. _id).  So Types.hs has something like:</p>

<p>data Page    = Page {_id :: Int, &#8230;}
data Comment = Comment {_id :: Int, &#8230;}</p>

<p>Since the field labels are just functions, GHC complains about _id being defined twice&#8230;  Doh.</p>

<p>Christopher,</p>

<p>That would separate like/related bits of code from each other.  I&#8217;m kinda sad that a compiler issue is forcing me to organize my code into non-intuitive blocks&#8230;</p>

<p>Victor,</p>

<p>Doh!  As mentioned above, Types.hs won&#8217;t work (because of multiply defined &#8220;_id&#8221;)&#8230;</p>

<p>Argh&#8230;  This is getting ugly.</p>

<p>Alson</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Saizan</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-78</link>
		<dc:creator>Saizan</dc:creator>
		<pubDate>Mon, 05 Jan 2009 02:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-78</guid>
		<description>&lt;p&gt;I don&#039;t get why Fix #1 shouldn&#039;t work as it is.
If Page is defined in Types it doesn&#039;t matter if both PageModel and CommentModel re-export it, the compiler knows that it&#039;s the same Page type.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I don&#8217;t get why Fix #1 shouldn&#8217;t work as it is.
If Page is defined in Types it doesn&#8217;t matter if both PageModel and CommentModel re-export it, the compiler knows that it&#8217;s the same Page type.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Victor</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-76</link>
		<dc:creator>Victor</dc:creator>
		<pubDate>Sun, 04 Jan 2009 22:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-76</guid>
		<description>&lt;p&gt;Why should you export Types.hs from other models? What about not doing it and requireing user to manually export Types.hs in order to refer any model?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Why should you export Types.hs from other models? What about not doing it and requireing user to manually export Types.hs in order to refer any model?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Lane Hinson</title>
		<link>http://www.alsonkemp.com/haskell/sad-about-import-cycles/comment-page-1/#comment-72</link>
		<dc:creator>Christopher Lane Hinson</dc:creator>
		<pubDate>Sun, 04 Jan 2009 16:13:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.alsonkemp.com/?p=227#comment-72</guid>
		<description>&lt;p&gt;If you still have import cycles after pushing types into Types.hs, then start moving functions into new modules.&lt;/p&gt;

&lt;p&gt;Either pull them up into something higher-level that knows about both Page and Comment models, or push them down into something primitive that doesn&#039;t know about either.&lt;/p&gt;

&lt;p&gt;Mutually recursive modules are stinky in any language!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you still have import cycles after pushing types into Types.hs, then start moving functions into new modules.</p>

<p>Either pull them up into something higher-level that knows about both Page and Comment models, or push them down into something primitive that doesn&#8217;t know about either.</p>

<p>Mutually recursive modules are stinky in any language!</p>]]></content:encoded>
	</item>
</channel>
</rss>
