Chris Smith's completely unique view

Algorithms, functional programming, CLR 4.0, and of course, F#!

Browse by Tags

Tagged Content List
  • Blog Post: F# Zen - Array slices

    Sorry for not being as regular with blogging, I've been sick and working hard on something pretty exciting. Don will post an announcement sooner or later. Anyways, did you know that in F# you can easily take out a chunk of an array using an Array Slice? This is a simple syntax for selecting a subset...
  • Blog Post: F# Zen - ROT13

    Below is a primitive implementation of ROT13 / Ceasar Cipher in F#. In short it is a simple encryption algorithm that works by 'shifting' each letter 13 places. So an 'a' becomes an 'n', a 'b' becomes an 'o', and so on. To decrypt the text you simply move 13 places in reverse. We can do this in F# easily...
  • Blog Post: F# Elevator Pitch

    At the PDC I spent about eight hours a day for a full week answering the same question again and again: “What is F# and why should I use it.” While I would love to give a long and nuanced answer to this, in order to achieve a high throughput you need to resort to using the Elevator Pitch style. The...
  • Blog Post: F# Zen – The Literal Attribute

    When pattern matching it is easy to forget that you are capturing a new value instead of matching against an existing one. Take this function for example: let E = 2.718281828459 let PI = 3.141592653589 // Ooops - this captures a value let isConstant x = match x with | PI | E -> true...
  • Blog Post: F# Zen - Colored printf

    It’s easy to lose track of important data when logging output to the console window, fortunately you can use the System.Console.ConsoleColor property to set the output color. But unlike F#’s printfn, System.Console.WriteLine doesn’t use type inference and feels much different than the printf and printfn...
  • Blog Post: F# Scripting Zen – Word Interop

    Edit: Added a ‘comarg’ function to dramatically clean up the syntax for doing COM-interop, since F# will pass ‘ref types’ as byrefs to COM calls. In a previous post I talked about how to take advantage of .FSX (F# Script) files to automate tasks for you. In this post I would like to share a script which...
Page 1 of 1 (6 items)