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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"outputs": {}, | |
"parameters": {}, | |
"resources": [ | |
{ | |
"apiVersion": "2020-06-01", | |
"dependsOn": [ | |
"[resourceId('Microsoft.Insights/components', 'safedeps-ai')]", |
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
#r "nuget:Azure.Data.Tables,3.0.0-beta.5" | |
open System | |
open Azure.Data.Tables | |
[<AutoOpen>] | |
module Extensions = | |
open System.Reflection | |
type PKey() = inherit Attribute() |
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
#r "nuget:microsoft.data.sqlclient" | |
open Microsoft.Data.SqlClient | |
let conn = new SqlConnection @"Server=(localdb)\ProjectsV13;Database=SampleDb;Integrated Security=True" | |
conn.Open() | |
#r "nuget:Dapper" | |
open Dapper | |
let anonRec = conn.Query<{| Id : int; Test : string |}> "SELECT Id, Test FROM dbo.[Table]" | |
let tupled = conn.Query<struct (int * string)> "SELECT Id, Test FROM dbo.[Table]" |
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
/// An example union. | |
type Team = Tottenham | Spurs | THFC | |
module Lists = | |
open FSharp.Reflection | |
/// Creates an array of all cases of a given union 'T. | |
let makeAll<'T> = | |
FSharpType.GetUnionCases typeof<'T> | |
|> Array.map(fun info -> FSharpValue.MakeUnion(info, Array.empty) :?> 'T) |
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
#r "nuget:WindowsAzure.Storage" | |
open Microsoft.WindowsAzure.Storage.Table | |
type Isaac = { Name : string; Age : int } | |
let typeCache = System.Collections.Generic.Dictionary() | |
let addToCache<'T>() = | |
let theType = typeof<'T> |
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 | |
let rnd = Random () | |
type Question = { Operator : string; A : int; B : int } | |
let createQuestions f operator = [ | |
for a in 1 .. 12 do | |
for b in 1 .. 12 do | |
{ Operator = operator |
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
#r "nuget:MBrace.Thespian" | |
open MBrace | |
open MBrace.Thespian | |
MBrace.Thespian.ThespianWorker.LocalExecutable <- "C:/Users/Isaac/.nuget/packages/mbrace.thespian/1.5.4/tools/mbrace.thespian.worker.exe" | |
let cluster = ThespianCluster.InitOnCurrentMachine(workerCount = 4) | |
(* |
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
// Couple of interfaces | |
type IFoo = interface end | |
type IBar = interface end | |
// Some records that implement the interfaces | |
type FooImpl1 = { Name : string } interface IFoo | |
type FooImpl2 = { OtherName : string } interface IFoo | |
type BarImpl1 = { Age : int } interface IBar |
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 BenchmarkDotNet.Attributes | |
open BenchmarkDotNet.Running | |
open BenchmarkDotNet.Jobs | |
[<SimpleJob(RuntimeMoniker.CoreRt31); SimpleJob(RuntimeMoniker.CoreRt50)>] | |
type Benchmarks() = | |
[<Benchmark; Arguments 1000; Arguments 10000; Arguments 100000; Arguments 1000000>] | |
member _.MapCreate size = | |
let hs = [| for i in 1 .. size -> i, i |] |> Map | |
[| for i in 1 .. size -> hs.[i] |] |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"outputs": {}, | |
"parameters": {}, | |
"resources": [ | |
{ | |
"apiVersion": "2019-06-01", | |
"dependsOn": [], | |
"kind": "StorageV2", |