Skip to content

Instantly share code, notes, and snippets.

// This is proof-of-concept code for using the F# from C#, so I'm putting
// the relevant snippets together in this one file
// F# code
namespace IntroDUs
module IntroDUs =
// This is a method of packing primitives into discriminated unions
// and using an extension property on the DU to provide direct access
@Kenneth-Posey
Kenneth-Posey / ASP.NET Session Value Manager
Created February 11, 2015 18:21
ASP.NET Session Value Manager
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
namespace SitefinityWebApp.Utility
{
public partial class ReferralAuthorizationForm : CustomControl.LoggedInUser
public abstract class SearchParameter
{
public abstract State.ValidState ValidState { get; set; }
public abstract string ClinicIds { get; set; }
}
public class State
{
public class ValidState
let frst = fst
let scnd = snd
let thrd (a, b, c) = c
let frth (a, b, c, d) = d
let ffth (a, b, c, d, e) = e
@Kenneth-Posey
Kenneth-Posey / gist:ca73d54e23d294546fa0
Created September 23, 2014 22:39
F# Image-Finder
namespace FsharpImaging
open System
open System.Drawing
open System.Drawing.Imaging
open System.Runtime.InteropServices
module ArrayFunctions =
// Generic because it makes testing easier, yay math
let IsSubMatrix (smallArray:'a[][]) (largeArray:'a[][]) (startCoordinate:(int * int)) =