Skip to content

Instantly share code, notes, and snippets.


Will Smith TIHan

View GitHub Profile

WIP F# 5.x Proposal Main Theme - Struct, ByRef, and Span updates


  • Implicit conversion to inref<_> on method calls
  • Static local functions via static let
  • Local functions can have a byref-like parameter type
  • Unmanaged constraint relaxation
  • Add implicit conversion of types to Span / ReadOnlySpan on method calls. - needs proposal
  • Function pointer (delegate pointer) support - needs proposal - needed to support native and C# interop - might require FSharp.Core additions
View lexer.fs
module Lexer =
open System.Threading
open FSharp.Compiler.UnicodeLexing
open FSharp.Compiler.Range
open FSharp.Compiler.Ast
open FSharp.Compiler.Text
open FSharp.Compiler.Features
open FSharp.Compiler.Parser
open FSharp.Compiler.Lexhelp
TIHan / process.fs
Created Nov 11, 2018
F# Process - Kill Child when Parent Dies
View process.fs
module WindowsHelpers =
open System.Runtime.InteropServices
open FSharp.NativeInterop
type JobObjectInfoType =
| AssociateCompletionPortInformation = 7
| BasicLimitInformation = 2
| BasicUIRestrictions = 4
| EndOfJobTimeInformation = 6
View gist:059002027f168c86b6d4739d9d05c45b
/Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/fsharp/fsc.exe -o:obj/Debug/AndroidFSharpSandbox.dll
View gist:c55e2aed0d8fab45db9dd98319c0fcf5
Tool /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/fsharp/fsc.exe execution started with arguments: -o:obj/Debug/AndroidFSharpSandbox.dll
View Benchmark.cs
class Benchmark
public void RunTypes()
var cache = typeof(string).Assembly.GetTypes().ToDictionary(x => x, x => x.Name.Length);
var sum = 0;
var sw = Stopwatch.StartNew();
var n = 1000000;
for (var i = 0; i < n; i++)
View style.fs
namespace Styles
// Style 1; OCaml Style
module Basketball =
type T =
Weight: int
TIHan / fixedStruct.fs
Created Feb 12, 2014
An unfinished type provider to handle fixed length types; it's broken. Do not use; but here for reference.
View fixedStruct.fs
module FSharp.BitMatch.TypeProvider
open System
open System.IO
open System.Reflection
open System.Windows.Input
open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Reflection
open Microsoft.FSharp.Quotations
View FParsec.Binary.fs
module FParsec.Binary
open System
open System.Text
open System.Text.RegularExpressions
open FParsec
module File =
let readAllString path =
View wadParser.fs
module WadParser
open System
open System.IO
open System.Text
open System.Text.RegularExpressions
open FParsec
module FParsec =