<?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: Simple Cabal parsing</title>
	<atom:link href="http://therning.org/magnus/archives/514/feed" rel="self" type="application/rss+xml" />
	<link>http://therning.org/magnus/archives/514</link>
	<description>Incoherent mumblings</description>
	<lastBuildDate>Tue, 24 Aug 2010 06:00:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Magnus</title>
		<link>http://therning.org/magnus/archives/514/comment-page-1#comment-171426</link>
		<dc:creator>Magnus</dc:creator>
		<pubDate>Thu, 26 Feb 2009 15:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=514#comment-171426</guid>
		<description>&lt;p&gt;@Duncan, thanks, that &lt;em&gt;does&lt;/em&gt; clarify it a bit.  Not that simple though ;-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Duncan, thanks, that <em>does</em> clarify it a bit.  Not that simple though <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Duncan</title>
		<link>http://therning.org/magnus/archives/514/comment-page-1#comment-171422</link>
		<dc:creator>Duncan</dc:creator>
		<pubDate>Thu, 26 Feb 2009 14:03:02 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=514#comment-171422</guid>
		<description>&lt;p&gt;Just to clarify...&lt;/p&gt;

&lt;p&gt;When you call finalizePackageDescription you get to say something about flag values. You can specify true or false or you can not specify it at all. Then finalizePackageDescription will come up with true/false values for the flags that you did not specify. It does this based on the default values for the flags (given in the .cabal file by the package author) but more interestingly based on the possible flag values given the flag-conditional dependencies and the set of available packages. Now you&#039;re not specifying any set of available packages (not the same as specifying none, then we could not finalise any package). So all constraints (that are not self-contradictory) will be presumed to be ok.&lt;/p&gt;

&lt;p&gt;The result is that (since you use Nothing for the set of available packages) you&#039;re getting the default flag values specified by the package author. Which as you say, is what you want. Just keep in mind that it need not correspond to any real configuration a user might even encounter, though it&#039;s probably the same or close most of the time.&lt;/p&gt;

&lt;p&gt;Simple right? :-)&lt;/p&gt;

&lt;p&gt;What we&#039;re doing, sort-of, is partially evaluating the package description using the available information. I&#039;m going to change this API in future to make it more flexible and to make the partial evaluation notion more explicit. We&#039;ll be able to partially evaluate a generic package description using any partial set of information, OS, arch, ghc version (or range of versions), available packages (again, not necessarily all available package) etc and get back another generic package description. We&#039;ve only finalised when we&#039;ve resolved all the choices. As you&#039;re doing above we should also be able to do that using default flag values and not using any set of available packages.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just to clarify&#8230;</p>

<p>When you call finalizePackageDescription you get to say something about flag values. You can specify true or false or you can not specify it at all. Then finalizePackageDescription will come up with true/false values for the flags that you did not specify. It does this based on the default values for the flags (given in the .cabal file by the package author) but more interestingly based on the possible flag values given the flag-conditional dependencies and the set of available packages. Now you&#8217;re not specifying any set of available packages (not the same as specifying none, then we could not finalise any package). So all constraints (that are not self-contradictory) will be presumed to be ok.</p>

<p>The result is that (since you use Nothing for the set of available packages) you&#8217;re getting the default flag values specified by the package author. Which as you say, is what you want. Just keep in mind that it need not correspond to any real configuration a user might even encounter, though it&#8217;s probably the same or close most of the time.</p>

<p>Simple right? <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p>What we&#8217;re doing, sort-of, is partially evaluating the package description using the available information. I&#8217;m going to change this API in future to make it more flexible and to make the partial evaluation notion more explicit. We&#8217;ll be able to partially evaluate a generic package description using any partial set of information, OS, arch, ghc version (or range of versions), available packages (again, not necessarily all available package) etc and get back another generic package description. We&#8217;ve only finalised when we&#8217;ve resolved all the choices. As you&#8217;re doing above we should also be able to do that using default flag values and not using any set of available packages.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Magnus</title>
		<link>http://therning.org/magnus/archives/514/comment-page-1#comment-171363</link>
		<dc:creator>Magnus</dc:creator>
		<pubDate>Wed, 25 Feb 2009 16:29:15 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=514#comment-171363</guid>
		<description>&lt;p&gt;@Antoine, I believe I&#039;d rather keep using &lt;code&gt;finalizePackageDescription&lt;/code&gt; even for newer versions of Cabal.  If I read it correctly &lt;code&gt;gPckgDeps&lt;/code&gt; simply pulls out the &lt;code&gt;PackageDescription&lt;/code&gt;, which AFAIU is at least similar to &lt;code&gt;flattenPackageDescription&lt;/code&gt;.  I really want to end up with the &quot;default package description&quot;, which I believe is what I get when using &lt;code&gt;finalizePackageDescription&lt;/code&gt; with an empty set of flags.&lt;/p&gt;

&lt;p&gt;@Duncan, actually I suppose I do care about flags, I want none to be set :-)  AFAIU that will give me the &quot;default package description&quot;, which is what I&#039;m after.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Antoine, I believe I&#8217;d rather keep using <code>finalizePackageDescription</code> even for newer versions of Cabal.  If I read it correctly <code>gPckgDeps</code> simply pulls out the <code>PackageDescription</code>, which AFAIU is at least similar to <code>flattenPackageDescription</code>.  I really want to end up with the &#8220;default package description&#8221;, which I believe is what I get when using <code>finalizePackageDescription</code> with an empty set of flags.</p>

<p>@Duncan, actually I suppose I do care about flags, I want none to be set <img src='http://therning.org/magnus/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   AFAIU that will give me the &#8220;default package description&#8221;, which is what I&#8217;m after.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Duncan</title>
		<link>http://therning.org/magnus/archives/514/comment-page-1#comment-171361</link>
		<dc:creator>Duncan</dc:creator>
		<pubDate>Wed, 25 Feb 2009 15:32:47 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=514#comment-171361</guid>
		<description>&lt;p&gt;Note that if you do not care about flags etc then you can use the even simpler flattenPackageDescription. However, be aware that that will give you the union of all possible dependencies. This is not the same as the set of dependencies in any particular configuration. Indeed the union of all version constraints may be impossible.&lt;/p&gt;

&lt;p&gt;On the other hand finalisePackageDescription gives you the result for one particular configuration. So it does not reflect what the deps would be for another configuration if the .cabal file uses conditional dependencies.&lt;/p&gt;

&lt;p&gt;So which one is right to use depends on what it is you are trying to do.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Note that if you do not care about flags etc then you can use the even simpler flattenPackageDescription. However, be aware that that will give you the union of all possible dependencies. This is not the same as the set of dependencies in any particular configuration. Indeed the union of all version constraints may be impossible.</p>

<p>On the other hand finalisePackageDescription gives you the result for one particular configuration. So it does not reflect what the deps would be for another configuration if the .cabal file uses conditional dependencies.</p>

<p>So which one is right to use depends on what it is you are trying to do.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Antoine Latter</title>
		<link>http://therning.org/magnus/archives/514/comment-page-1#comment-171326</link>
		<dc:creator>Antoine Latter</dc:creator>
		<pubDate>Wed, 25 Feb 2009 01:43:09 +0000</pubDate>
		<guid isPermaLink="false">http://therning.org/magnus/?p=514#comment-171326</guid>
		<description>&lt;p&gt;For scraping deps from the newer parts of Cabal syntax, you can check out my attempt over &lt;a href=&quot;http://panicsonic.blogspot.com/2009/02/dependencies-in-hackage-revisited.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You&#039;ll want to look at &lt;code&gt;gPckgDeps :: GenericPackageDescription -&gt; [Dependency]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It&#039;s a bit gruesome, I admit.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For scraping deps from the newer parts of Cabal syntax, you can check out my attempt over <a href="http://panicsonic.blogspot.com/2009/02/dependencies-in-hackage-revisited.html" rel="nofollow">here</a>.</p>

<p>You&#8217;ll want to look at <code>gPckgDeps :: GenericPackageDescription -&gt; [Dependency]</code>.</p>

<p>It&#8217;s a bit gruesome, I admit.</p>]]></content:encoded>
	</item>
</channel>
</rss>
