This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Program | |
open System | |
open System.Collections.Generic | |
open System.Diagnostics | |
let r = Random 42 | |
let count = 1000000 | |
let checkValueDate = DateTime (1980, 2, 18) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Diagnostics | |
let check<'a when 'a : equality>(x:'a, y:'a) = | |
for i=1 to 0 do failwith "this is just to stop f# inlining" | |
if x = y then 1 else 0 | |
let count = 50000000 | |
let tuple2 () = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Test | |
module HackedOutOfPrimTypes = | |
open System | |
open System.Collections | |
open System.Collections.Generic | |
open System.Reflection | |
open System.Runtime.CompilerServices | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type KeyStruct(_1':int, _2':int, _3':int) = struct | |
member this._1 = _1' | |
member this._2 = _2' | |
member this._3 = _3' | |
end | |
type KeyGenericStruct<'a>(_1':'a, _2':'a, _3':'a) = struct | |
member this._1 = _1' | |
member this._2 = _2' | |
member this._3 = _3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Perf | |
open System | |
open System.Diagnostics | |
open System.IO | |
open System.Collections.Generic | |
let inline run<'key when 'key : equality> (comparer:IEqualityComparer<'key>) (createKey:int -> int -> 'key) = | |
let g_maxSize = 4480 | |
let fileSizes = [ 1 .. 99 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.assembly hello {} | |
.class public auto ansi serializable beforefieldinit Library1.JumpBImpl`1<class (class [mscorlib]System.IEquatable`1<!a>) a> | |
extends [mscorlib]System.Object | |
{ | |
.method public specialname rtspecialname | |
instance void .ctor () cil managed | |
{ | |
.maxstack 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let depth = 1000000 | |
module Test = | |
let check basis createItem = | |
let rec createList n l = | |
if n = 0 then l | |
else createList (n-1) (createItem (int64 n, int64 n) l) | |
let a0 = createList depth basis | |
let a1 = createList depth basis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Threading | |
open System.Threading.Tasks | |
open System.Diagnostics | |
let bindBool (f: bool -> Task<bool>) (m: Task<bool>) = | |
if m.IsCompleted | |
then | |
f m.Result | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FSharp.Quotations | |
let rec getMethodInfo = function | |
| Patterns.Call(_,``method``,_) -> ``method`` | |
| Patterns.Lambda(_,body) -> getMethodInfo body | |
| _ -> failwith "Unexpected Form" | |
let getGenericMethodInfo functionExpression = | |
let methodInfo = getMethodInfo functionExpression | |
if methodInfo.IsGenericMethod then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SomeNamespace.String | |
open System | |
open System.Globalization | |
let inline private safe s = | |
match s with | |
| null -> String.Empty | |
| _ -> s |
OlderNewer