<?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"
	>
<channel>
	<title>Comments on: Tuples rock my world</title>
	<atom:link href="http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/feed/" rel="self" type="application/rss+xml" />
	<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/</link>
	<description>...and again, and again, and once more</description>
	<pubDate>Wed, 10 Mar 2010 17:04:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Mauricio</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-57</link>
		<dc:creator>Mauricio</dc:creator>
		<pubDate>Thu, 08 Jan 2009 20:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-57</guid>
		<description>@David:
I've been using exactly that, a tryparse that returns an option:

let tryParseInt a = 
    match Int32.TryParse a with
    &#124; (false, _) -&#62; None
    &#124; (true, x) -&#62; Some x</description>
		<content:encoded><![CDATA[<p>@David:<br />
I&#8217;ve been using exactly that, a tryparse that returns an option:</p>
<p>let tryParseInt a =<br />
    match Int32.TryParse a with<br />
    | (false, _) -&gt; None<br />
    | (true, x) -&gt; Some x</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryanne</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-48</link>
		<dc:creator>Bryanne</dc:creator>
		<pubDate>Tue, 28 Oct 2008 23:06:22 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-48</guid>
		<description>Good post.</description>
		<content:encoded><![CDATA[<p>Good post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-37</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 09 May 2008 21:20:16 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-37</guid>
		<description>helium&#62; Pretty cool. Even cooler would be some kind of active pattern.

Don't know if I misunderstand you, but you can simply do this in F#:

match Int32.TryParse(xxx), Int32.TryParse(yyy) with
  &#124; (true, foo), (true, bar) -&#62; (* something *)
  &#124; _ -&#62; (* otherwise *)

Anyone still not agreeing with Kurt?

Btw, a real F#-ish TryParse would return an option value, with which it could look like this:

match Int32.TryParse xxx, Int32.TryParse yyy with
  &#124; Some foo, Some bar -&#62; (* something *)
  &#124; _ -&#62; (* otherwise *)</description>
		<content:encoded><![CDATA[<p>helium&gt; Pretty cool. Even cooler would be some kind of active pattern.</p>
<p>Don&#8217;t know if I misunderstand you, but you can simply do this in F#:</p>
<p>match Int32.TryParse(xxx), Int32.TryParse(yyy) with<br />
  | (true, foo), (true, bar) -&gt; (* something *)<br />
  | _ -&gt; (* otherwise *)</p>
<p>Anyone still not agreeing with Kurt?</p>
<p>Btw, a real F#-ish TryParse would return an option value, with which it could look like this:</p>
<p>match Int32.TryParse xxx, Int32.TryParse yyy with<br />
  | Some foo, Some bar -&gt; (* something *)<br />
  | _ -&gt; (* otherwise *)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Building an F# powered indexing system &#60; Trying This Again</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-34</link>
		<dc:creator>Building an F# powered indexing system &#60; Trying This Again</dc:creator>
		<pubDate>Wed, 07 May 2008 22:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-34</guid>
		<description>[...] The SchemaField type needs two basic pieces of information, a label and a set of options. I don't know about you, but when I read "two pieces of information", I think tuple: [...]</description>
		<content:encoded><![CDATA[<p>[...] The SchemaField type needs two basic pieces of information, a label and a set of options. I don&#8217;t know about you, but when I read &#8220;two pieces of information&#8221;, I think tuple: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: helium</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-35</link>
		<dc:creator>helium</dc:creator>
		<pubDate>Mon, 05 May 2008 13:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-35</guid>
		<description>let first, foo = Int32.TryParse(xxx);
let second, bar = Int32.TryParse(yyy);


if first &#38;&#38; second then (* dothomething with first and second *) else (* default behaviour *)


Pretty cool. Even cooler would be some kind of active pattern.

match (xxx, yyy) with
&#124; (parse(first), parse(second)) -&#62; (* dothomething with first and second *)
&#124; _ -&#62; (* default behaviour *)</description>
		<content:encoded><![CDATA[<p>let first, foo = Int32.TryParse(xxx);<br />
let second, bar = Int32.TryParse(yyy);</p>
<p>if first &amp;&amp; second then (* dothomething with first and second *) else (* default behaviour *)</p>
<p>Pretty cool. Even cooler would be some kind of active pattern.</p>
<p>match (xxx, yyy) with<br />
| (parse(first), parse(second)) -&gt; (* dothomething with first and second *)<br />
| _ -&gt; (* default behaviour *)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Klaus</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-36</link>
		<dc:creator>Klaus</dc:creator>
		<pubDate>Fri, 18 Apr 2008 06:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-36</guid>
		<description>I have made som very basic stuff for retreiving nullable types from TryParse:
http://www.khebbie.dk/post/2008/04/Nullable-TryParse.aspx</description>
		<content:encoded><![CDATA[<p>I have made som very basic stuff for retreiving nullable types from TryParse:<br />
<a href="http://www.khebbie.dk/post/2008/04/Nullable-TryParse.aspx" rel="nofollow">http://www.khebbie.dk/post/2008/04/Nullable-TryParse.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C# vs F#: some parallel refactoring (and generalization) &#60; Trying This Again</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-22</link>
		<dc:creator>C# vs F#: some parallel refactoring (and generalization) &#60; Trying This Again</dc:creator>
		<pubDate>Wed, 16 Apr 2008 19:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-22</guid>
		<description>[...] shortly after adding the more in depth examples in my last post, I started playing around with the TryParse method in C# to see how "nice" I could make the example [...]</description>
		<content:encoded><![CDATA[<p>[...] shortly after adding the more in depth examples in my last post, I started playing around with the TryParse method in C# to see how &#8220;nice&#8221; I could make the example [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daniel</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-26</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Wed, 16 Apr 2008 18:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-26</guid>
		<description>I was just using Nullable as an example of returning a class instead of using an out parameter.

My point is you _can_ have "tupley" =) code in C#, it's just called a "return type".  In the case of the dictionary example:

var result = myDictionary.TryGetValue(key);
if (result.IsValidKey)
{
...result.Value
}
Where "TryGetValue" is an extension method that returns a custom type.

Granted, you don't get the language-baked feature to automatically do this, but with a few good extension methods, you wouldn't miss it =)</description>
		<content:encoded><![CDATA[<p>I was just using Nullable as an example of returning a class instead of using an out parameter.</p>
<p>My point is you _can_ have &#8220;tupley&#8221; =) code in C#, it&#8217;s just called a &#8220;return type&#8221;.  In the case of the dictionary example:</p>
<p>var result = myDictionary.TryGetValue(key);<br />
if (result.IsValidKey)<br />
{<br />
&#8230;result.Value<br />
}<br />
Where &#8220;TryGetValue&#8221; is an extension method that returns a custom type.</p>
<p>Granted, you don&#8217;t get the language-baked feature to automatically do this, but with a few good extension methods, you wouldn&#8217;t miss it =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garry</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-28</link>
		<dc:creator>Garry</dc:creator>
		<pubDate>Wed, 16 Apr 2008 18:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-28</guid>
		<description>Tuples rock!

However, it seems, in this case, that it would make more sense to have a bool Int32.CanParse(string value) method.

And, move the TryParse methods to a special System.ICryAboutPerformance namespace.

Just a thought.</description>
		<content:encoded><![CDATA[<p>Tuples rock!</p>
<p>However, it seems, in this case, that it would make more sense to have a bool Int32.CanParse(string value) method.</p>
<p>And, move the TryParse methods to a special System.ICryAboutPerformance namespace.</p>
<p>Just a thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://tryingthisagain.com/2008/04/08/tuples-rock-my-world/#comment-27</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 16 Apr 2008 18:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://tryingthisagain.com/?p=30#comment-27</guid>
		<description>Kurt,

It may be better to say what I am thinking. I was not aware of tuple's either and F# does seem to have an elegant way of handling multiple return values.</description>
		<content:encoded><![CDATA[<p>Kurt,</p>
<p>It may be better to say what I am thinking. I was not aware of tuple&#8217;s either and F# does seem to have an elegant way of handling multiple return values.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.374 seconds -->
