<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>FSharp3Sample Discussions Rss Feed</title><link>http://fsharp3sample.codeplex.com/discussions</link><description>FSharp3Sample Discussions Rss Description</description><item><title>New Post: Unable to load the solution on VS2010 and VS2012 Express</title><link>http://fsharp3sample.codeplex.com/discussions/396050</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;VS2010 complains the solution &amp;nbsp;is created by a newer version, VS12 complains this project is unsupported.&lt;/p&gt;
&lt;p&gt;How can I resolve this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Val&lt;/p&gt;
&lt;/div&gt;</description><author>VallarasuS</author><pubDate>Wed, 19 Sep 2012 09:49:29 GMT</pubDate><guid isPermaLink="false">New Post: Unable to load the solution on VS2010 and VS2012 Express 20120919094929A</guid></item><item><title>New Post: Use of pattern matching to implement standard design patterns affects extensibility</title><link>http://fsharp3sample.codeplex.com/discussions/276281</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Great suggestion, Gdecaso..&amp;nbsp;&lt;/p&gt;
&lt;p&gt;we will make a change according to your suggestion.&lt;/p&gt;&lt;/div&gt;</description><author>ttliu2000</author><pubDate>Mon, 30 Apr 2012 04:05:16 GMT</pubDate><guid isPermaLink="false">New Post: Use of pattern matching to implement standard design patterns affects extensibility 20120430040516A</guid></item><item><title>New Post: License</title><link>http://fsharp3sample.codeplex.com/discussions/281126</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the license is:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Apache License&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Version 2.0, January 2004&lt;/span&gt;&lt;br /&gt;&lt;span&gt;http://www.apache.org/licenses/&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><author>ttliu2000</author><pubDate>Mon, 30 Apr 2012 03:36:26 GMT</pubDate><guid isPermaLink="false">New Post: License 20120430033626A</guid></item><item><title>New Post: OO Design patterns are not "advanced F#"</title><link>http://fsharp3sample.codeplex.com/discussions/350140</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;In my opinion advanced F# would be language specific features like:&lt;/p&gt;
&lt;p&gt;- Builder pattern (computational expressions)&lt;/p&gt;
&lt;p&gt;- MailboxProcessor&lt;/p&gt;
&lt;p&gt;- Numeric literals&lt;/p&gt;
&lt;p&gt;- Active pattern (not very useful, but is already...nice!)&lt;/p&gt;
&lt;p&gt;- Quotations&lt;/p&gt;
&lt;p&gt;- ...&lt;/p&gt;&lt;/div&gt;</description><author>Thorium</author><pubDate>Wed, 25 Apr 2012 21:47:39 GMT</pubDate><guid isPermaLink="false">New Post: OO Design patterns are not "advanced F#" 20120425094739P</guid></item><item><title>New Post: Use of pattern matching to implement standard design patterns affects extensibility</title><link>http://fsharp3sample.codeplex.com/discussions/276281</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;&lt;br /&gt;Design Patterns are common "best practice" ways to manage object-oriented problems that doesn't exist in functional language. While it is nice to have some sample code here, I think OO-patterns may noy be the best thing.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Why would you use ICommand anyway? Next you need some IHasPermission to check that no-one can't inject your code. And so on. While you could use the function as type in the first place.&lt;/p&gt;
&lt;p&gt;Or if you absolutely want to just execute:&lt;/p&gt;
&lt;pre&gt;let Do f = f()&lt;/pre&gt;
&lt;p&gt;(silly method) or maybe:&lt;/p&gt;
&lt;pre&gt;let Do hasPermissions f = 
    if hasPermissions() then f()&lt;/pre&gt;
&lt;hr /&gt;
&lt;p&gt;Generally I would say extensibility is not the problem in functional programming as it is in OO-world. The reason is that with OO you try to bottom-up model the whole world. In functional programming you can use partial application and compose things with top-down design.&lt;/p&gt;
&lt;p&gt;I could make:&lt;/p&gt;
&lt;pre&gt;let myProcess = Save &amp;gt;&amp;gt; Validate &amp;gt;&amp;gt; Send&lt;/pre&gt;
&lt;p&gt;without even yet defining the parameter, the object x, when in OO I should first define every property of this x.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Usually business logic is messy unstructured if-jungle.&lt;br /&gt;You can solve this with pattern matching which keeps your complex logic clean.&lt;/p&gt;
&lt;p&gt;I discussed this with a Java-architect and here are some examples of his sample Java-code&amp;nbsp;as F#:&lt;br /&gt;&lt;a href="http://pastebin.com/2uKMDRsx"&gt;http://pastebin.com/2uKMDRsx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://pastebin.com/BQfCu0fS"&gt;http://pastebin.com/BQfCu0fS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>Thorium</author><pubDate>Tue, 27 Mar 2012 04:01:04 GMT</pubDate><guid isPermaLink="false">New Post: Use of pattern matching to implement standard design patterns affects extensibility 20120327040104A</guid></item><item><title>New Post: OO Design patterns are not "advanced F#"</title><link>http://fsharp3sample.codeplex.com/discussions/350140</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;GoF Design patterns described by this sample pack are not advanced F# but object oriented programming.&lt;/p&gt;
&lt;p&gt;They should be under&amp;nbsp;some other topic than &amp;quot;Advanced&amp;quot;.&lt;/p&gt;
&lt;p&gt;How about &amp;quot;Avoid&amp;quot;?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>Thorium</author><pubDate>Tue, 27 Mar 2012 02:58:45 GMT</pubDate><guid isPermaLink="false">New Post: OO Design patterns are not "advanced F#" 20120327025845A</guid></item><item><title>New Post: Beta needs web services updates</title><link>https://fsharp3sample.codeplex.com/discussions/349362</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Installed the 3.0 Samples Beta - there are a few build errors - mainly having to do with the web services.&lt;/p&gt;
&lt;/div&gt;</description><author>danfay</author><pubDate>Tue, 20 Mar 2012 18:28:58 GMT</pubDate><guid isPermaLink="false">New Post: Beta needs web services updates 20120320062858P</guid></item><item><title>New Post: License</title><link>http://fsharp3sample.codeplex.com/discussions/281126</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;How can I use this samples as example for produce another language sample pack?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is Nemerle language, semantically it&amp;nbsp;closest to F#. Of course, links to&amp;nbsp;&lt;a href="http://fsharp3sample.codeplex.com/"&gt;http://fsharp3sample.codeplex.com&lt;/a&gt;&amp;nbsp;will be published.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the great work!&lt;/p&gt;
&lt;/div&gt;</description><author>ziaw</author><pubDate>Tue, 29 Nov 2011 06:01:31 GMT</pubDate><guid isPermaLink="false">New Post: License 20111129060131A</guid></item><item><title>New Post: Use of pattern matching to implement standard design patterns affects extensibility</title><link>http://fsharp3sample.codeplex.com/discussions/276281</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm an avid F# 2.0 user as well as some prior experiences with Java, where I used design patterns quite&amp;nbsp;aggressively.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;While looking at the design patterns proposed in this project, I see that most of them (if not all of them) are implemented using pattern matching. While this might seem natural and easy to read in a language like F#, it is generally not recommended when
 designing software in general, since pattern matching violates the open/closed principle (see&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Open/closed_principle"&gt;http://en.wikipedia.org/wiki/Open/closed_principle&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;span style="direction:ltr"&gt;For instance, the command pattern example posted in this project (&lt;a href="http://fsharp3sample.codeplex.com/wikipage?title=Command%20pattern"&gt;http://fsharp3sample.codeplex.com/wikipage?title=Command%20pattern&lt;/a&gt;) defines a CommandType
 as an enumerate with two values Deposit and Withdraw. The Do and Undo functions pattern match on these enumerate values to decide what to do.
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="direction:ltr"&gt;While this achieves the desired functionality, it provides no extensibility at all. If I wanted to add a third operation (say PrintBalance), I would have to manually change all of the places where the CommandType is pattern matched
 (I have to admit that the F# compiler would warn if one such pattern matching expression is not updated, but still..).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In my opinion, this design pattern would be better implemented if the TCommand type is defined as follows:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;type TCommand =
   { Amount : int
      Do: int -&amp;gt; int -&amp;gt; int;
      Undo: int -&amp;gt; int -&amp;gt; int;
      Name: string }

let withdraw x = { Amount = x; Do = (-); Undo = (&amp;#43;); Name = &amp;quot;Withdraw&amp;quot; }

let deposit x = { Amount = x; Do = (&amp;#43;); Undo = (-); Name = &amp;quot;deposit&amp;quot; }

let operate (balance: int) (c: TCommand) =
  printfn &amp;quot;Doing a %s operation&amp;quot; c.Name
  let newBalance = c.Do c.Amount balance
  printfn &amp;quot;New balance is %O&amp;quot; newBalance 
  newBalance&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Excuse me if it does not compile, I have no access to an F# compiler right now (not even
&lt;a href="http://www.tryfsharp.org/"&gt;http://www.tryfsharp.org&lt;/a&gt;, due to browser plug-in requirements).&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Guido&lt;/p&gt;
&lt;/div&gt;</description><author>gdecaso</author><pubDate>Tue, 18 Oct 2011 12:34:56 GMT</pubDate><guid isPermaLink="false">New Post: Use of pattern matching to implement standard design patterns affects extensibility 20111018123456P</guid></item><item><title>New Post: Use of pattern matching to implement standard design patterns affects extensibility</title><link>http://fsharp3sample.codeplex.com/discussions/276281</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm an avid F# 2.0 user as well as some prior experiences with Java, where I used design patterns quite&amp;nbsp;aggressively.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;While looking at the design patterns proposed in this project, I see that most of them (if not all of them) are implemented using pattern matching. While this might seem natural and easy to read in a language like F#, it is generally not recommended when
 designing software in general, since pattern matching violates the open/closed principle (see&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Open/closed_principle"&gt;http://en.wikipedia.org/wiki/Open/closed_principle&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;span style="direction:ltr"&gt;For instance, the command pattern example posted in this project (&lt;a href="http://fsharp3sample.codeplex.com/wikipage?title=Command%20pattern"&gt;http://fsharp3sample.codeplex.com/wikipage?title=Command%20pattern&lt;/a&gt;) defines a CommandType
 as an enumerate with two values Deposit and Withdraw. The Do and Undo functions pattern match on these enumerate values to decide what to do.
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="direction:ltr"&gt;While this achieves the desired functionality, it provides no extensibility at all. If I wanted to add a third operation (say PrintBalance), I would have to manually change all of the places where the CommandType is pattern matched
 (I have to admit that the F# compiler would warn if one such pattern matching expression is not updated, but still..).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In my opinion, this design pattern would be better implemented if the TCommand type is defined as follows:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;type TCommand =
   { Amount : int
      Do: int -&amp;gt; int -&amp;gt; int;
      Undo: int -&amp;gt; int -&amp;gt; int;
      Name: string }

let withdraw x = { Amount = x; Do = (-); Undo = (&amp;#43;); Name = &amp;quot;Withdraw&amp;quot; }

let deposit x = { Amount = x; Do = (&amp;#43;); Undo = (-); Name = &amp;quot;deposit&amp;quot; }

let operate (balance: int) (c: TCommand) =
  printfn &amp;quot;Doing a %s operation&amp;quot; c.Name
  let newBalance = c.Do c.Amount balance
  printfn &amp;quot;New balance is %O&amp;quot; newBalance 
  newBalance&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Excuse me if it does not compile, I have no access to an F# compiler right now (not even
&lt;a href="http://www.tryfsharp.org/"&gt;http://www.tryfsharp.org&lt;/a&gt;, due to browser plug-in requirements).&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Guido&lt;/p&gt;
&lt;/div&gt;</description><author>gdecaso</author><pubDate>Tue, 18 Oct 2011 12:34:56 GMT</pubDate><guid isPermaLink="false">New Post: Use of pattern matching to implement standard design patterns affects extensibility 20111018123456P</guid></item></channel></rss>