This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ============================== | |
// This gist is in response to | |
// http://programmers.stackexchange.com/questions/228939/how-to-improve-upon-blochs-builder-pattern-to-make-it-more-appropriate-for-use | |
// | |
// This is a simple bit of code to do the same thing using the Either monad (e.g. success/failure) and applicatives | |
// This code is (a) more generic (b) much shorter (c) more type safe | |
// | |
// Compare with the Java code at https://gist.github.com/swlaschin/9009343 | |
// ============================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ============================== | |
// This gist contains the code from | |
// http://programmers.stackexchange.com/questions/228939/how-to-improve-upon-blochs-builder-pattern-to-make-it-more-appropriate-for-use | |
// | |
// Compare with the functional version at https://gist.github.com/swlaschin/9008814 | |
// ============================== | |
// ========================================== | |
// UserConfig.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//=================================== | |
// Example of using DataTables in F# | |
//=================================== | |
open System | |
open System.Data | |
//=================================== | |
// General DataTable helpers | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ================================================ | |
// DDD : Model a card game | |
// ================================================ | |
(* | |
A card is a combination of a Suit (Heart, Spade) and a Rank (Two, Three, ... King, Ace) | |
A hand is a list of cards | |
A deck is a list of cards | |
A player has a name and a hand | |
A game consists of a deck and list of players |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ================================= | |
// Demonstration of using FsCheck to | |
// test "add" implementations | |
// | |
// This is a more thorough version of the example | |
// in the talk at fsharpforfunandprofit.com/pbt | |
// ================================= | |
System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
typesafe-performance-with-compiler-directives-1.fsx | |
Demonstrates some techniques for performance improvements while remaining type-safe. | |
Related blog post: http://fsharpforfunandprofit.com/posts/typesafe-performance-with-compiler-directives/ | |
See also the others in this series: "typesafe-performance-with-compiler-directives-XXX".fsx | |
*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
RecursiveTypesAndFold-2b.fsx | |
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-2b/ | |
*) | |
// ============================================== | |
// PART 2b - Understanding Folds | |
// ============================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
RecursiveTypesAndFold-3.fsx | |
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3/ | |
*) | |
// ============================================== | |
// PART 3 - Generic recursive types | |
// ============================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
RecursiveTypesAndFold-3b-tree.fsx | |
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/ | |
*) | |
// ============================================== | |
// PART 3b - Generic tree type | |
// ============================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
RecursiveTypesAndFold-3b-listing.fsx | |
Example: Creating a listing from a file system | |
Related blog post: http://fsharpforfunandprofit.com/posts/recursive-types-and-folds-3b/ | |
*) | |
// ============================================== | |
// PART 3b - File System Listing |
OlderNewer