F# Bloggers

Blog articles of F# Bloggers

0
comment
on 8/14/2015 8:47 AM
In part one of this series we walked through modeling the domain of our card game. In this post we'll use that domain as a guide to help us create a deck, shuffle the deck, and deal cards from the deck. Creating the deck There may be more elegant ways to do this, but for now we'll simply define a value and populate it with the cards. let newDeck = [(Two, Spades); (Three, Spades); (Four, Spades); (Five, Spades); (Six, Spades); (Seven, Spades); (Eight, Spades); (Nine, Spades); (Ten, Spa[...]
>> Read the full article
.
0
comment
on 8/8/2015 6:42 PM
A couple of weeks ago, I came across this blog post by Steve Shogren, which looks at various programming languages, and attempts to define a “language safety score”, by taking into account a list of language criteria (Are nulls allowed? Can variables be mutated? And so on), aggregating them into an overall safety score – and finally looking for whether the resulting score was a reasonable predictor for the observed bug rate across various projects. I thought this was an interesting idea. However, I also h[...]
>> Read the full article
.
0
comment
on 8/7/2015 5:53 AM
I know what's like in the summertime, a bit quiet, so I thought it would be fun to build a Robot Arm, and to control it from a Raspberry Pi using self written F# software. Project goals are: have fun, learn some, and if possible, do a "Sean's dad" trick: inspire a kid.The ingredients are: One Raspberry Pi 2B (quad core!) plus accessories (power, network cable, HDMI cable), a clean Micro SD card (cat 10) with adaptor, a USB keyboard, a MeArm robot arm, four Servo motor cord extensions (3x10cm 1x2 [...]
>> Read the full article
.
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
.
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