This file contains hidden or 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
| [<RequireQualifiedAccess>] | |
| module Async = | |
| let map handler work = async { | |
| let! work = work | |
| return handler work } |
This file contains hidden or 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
| (* QUEUES | |
| https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.queue-1 | |
| *) | |
| // 1.0 Basic queue - hand-rolled | |
| let q = System.Collections.Generic.Queue<string>() | |
| q.Enqueue "Hello" |
This file contains hidden or 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": "2016-08-01", | |
| "dependsOn": [ | |
| "sites_omg_backend_name-plan" |
This file contains hidden or 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
| // Change this to your profile folder for nuget packages | |
| #I @"C:\Users\Isaac\.nuget\packages\" | |
| #r @"XPlot.GoogleCharts\2.0.0\lib\netstandard2.0\XPlot.GoogleCharts.dll" | |
| #r @"Newtonsoft.Json\12.0.3\lib\netstandard2.0\Newtonsoft.Json.dll" | |
| #r @"Google.DataTable.Net.Wrapper\4.0.0\lib\netstandard2.0\Google.DataTable.Net.Wrapper.dll" | |
| open System | |
| open XPlot.GoogleCharts | |
| /// Executes an asynchronous workflow and provides some simple statistics on the results. |
This file contains hidden or 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 x = | |
| [| 1 .. 10 |] | |
| |> Array.map(fun n -> async { | |
| printfn "Starting %d" n | |
| do! Async.Sleep 1000 | |
| printfn "Done %d" n | |
| return n * 1000 | |
| }) | |
| let x2 = Async.Parallel(x, 1) |> Async.RunSynchronously |
This file contains hidden or 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 Async = | |
| let Bind continuation wf = async { | |
| let! wf = wf | |
| return! continuation wf | |
| } | |
| let Map continuation = Bind (continuation >> async.Return) | |
| // e.g. | |
| let workflow = async { return 10 } |
This file contains hidden or 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 (|Mod|_|) div value = | |
| if value % div = 0 then Some() else None | |
| let fizzBuzz = function | |
| | Mod 3 & Mod 5 -> "FizzBuzz" | |
| | Mod 3 -> "Fizz" | |
| | Mod 5 -> "Buzz" | |
| | n -> string n | |
| [ 1 .. 100 ] |
This file contains hidden or 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/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "outputs": {}, | |
| "parameters": {}, | |
| "resources": [ | |
| { | |
| "apiVersion": "2016-08-01", | |
| "dependsOn": [ | |
| "mysuperwebappisaac-plan", |
This file contains hidden or 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 x = "TEST".Split ", " |> Array.item 1 |
This file contains hidden or 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
| Unhandled exception. System.AggregateException: One or more errors occurred. (Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.) | |
| ---> System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. | |
| ---> System.ComponentModel.Win32Exception (258): The wait operation timed out. | |
| at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) | |
| at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) | |
| at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) | |
| at System.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning(Boolean callerHasConnectionLock, Boolean asyncClose) | |
| at System.Data.SqlClient.TdsParserStateOb |