F# Bloggers

Blog articles of F# Bloggers

0
comment
on 8/5/2015 3:11 PM
This is the first post in a series where we'll walk through creating the card game Crazy Eights in F#. Playing cards are a fairly well known domain and, despite the name, Crazy Eights is quite easy to understand. In this post we'll walk through modeling the domain. Modeling our Domain Crazy Eights is played with a standard 52 card deck which means we have Deuce through Ace and the four suits but no Jokers. To model these cases we'll use two Discriminated Unions, one for Suit and one for Rank. type Su[...]
>> Read the full article
.
0
comment
on 7/31/2015 1:51 PM
When I started learning F# I had a hard time grokking how and when to use a Discriminated Union (Sum type). I had experience in several paradigms and languages, but had never seen or used this data construct. In this article we'll start with an Enum and then work our way into an example use case with a Discriminated Union enum HttpMethod { Get, Post } An Enum is basically a constrained type where an instance of the enum must be one of the specified values. For an instance to be of the type HttpM[...]
>> Read the full article
.
0
comment
on 7/19/2015 1:59 PM
Source code for this post can be found on my GitHub. It’s great to see technologies evolving over the years. Alea.CUDA has done so in leaps and bounds since the first time I laid eyes on it a couple of years ago. At the time the name seemed unfortunate and hinted at the “aleatic” programming […]
>> Read the full article
.
0
comment
on 7/17/2015 5:56 AM
In a previous post on F# data access I dropped a hint about a functional way of handling invalid arguments. The code in question looked like this. let insertLocation city state = if state |> String.length >= 2 then DataAccess.createLocation city state else raise (System.ArgumentException("Not a valid State")) If you're new to the functional paradigm you may not see any issue with this code. To explain why this isn't an ideal solution let's first look at a simpler function. let divide x[...]
>> Read the full article
.
0
comment
on 7/9/2015 2:09 PM
One of my biggest hurdles when starting with F# was how I should structure an actual application. There was documentation for individual libraries and scripts but not so much for app structure this post by Scott Wlaschin is fantastic, but is at a different level than I fully understood at that point in my F# journey. The goal of this post is to provide a bridge to help developers new to F#. Getting Started The first thing to do will be to create a new F# application. For this tutorial I'll use the F[...]
>> Read the full article
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper