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 genericMapReduce toOutput folder src = | |
src | |
|> Seq.map toOutput | |
|> Seq.reduce folder | |
let inline mapReduceAdd toOutput src = | |
src |> genericMapReduce toOutput (+) | |
type Person = | |
{ Name : string |
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 a = new obj(); | |
let b = new obj(); | |
let c = new obj(); | |
a.Equals(b) // <- false | |
b.Equals(c) // <- false | |
c.Equals(a) // <- false | |
let aList = [a] // <- [System.Object] | |
let bList = [b] // <- [System.Object] |
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 Test | |
open System | |
open System.Threading.Tasks | |
open System.Diagnostics | |
open BenchmarkDotNet | |
open BenchmarkDotNet.Running | |
open BenchmarkDotNet.Attributes | |
let f input = |
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
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Schedulers; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
namespace Test | |
{ | |
public class Worker |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
namespace ConsoleApp9 | |
{ |
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
#I @"C:\Users\___\.nuget\packages\hopac\0.3.23\lib\netstandard1.6" | |
#r "Hopac.dll" | |
#r "Hopac.Core.dll" | |
#r "Hopac.Platform.dll" | |
open System | |
open Hopac | |
open Hopac.Infixes | |
open Hopac.Stream |
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
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp2.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" /> | |
</ItemGroup> |
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 @"./packages/Hopac/lib/net45/Hopac.Core.dll" | |
#r @"./packages/Hopac/lib/net45/Hopac.dll" | |
open Hopac | |
open Hopac.Stream | |
open System | |
let requestDetailAsync url= | |
async { | |
Console.WriteLine ("Simulating request " + url) |
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.Threading | |
open System | |
let random = Random(int DateTime.UtcNow.Ticks) | |
let asyncMockup s = async { | |
let sleepFor = int (random.NextDouble() * 3000.) | |
do! Async.Sleep sleepFor | |
return sprintf "resulted %s" s | |
} |
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 random = Random(int DateTime.UtcNow.Ticks) | |
let asyncMockup s = async { | |
let sleepFor = int (random.NextDouble() * 3000.) | |
//let sleepFor = 2000 | |
do! Async.Sleep sleepFor | |
printfn "resulted %s" s | |
return sprintf "resulted %s" s |
OlderNewer