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
| // step0: quick intro about paket, fake, |> operator and unit | |
| // ------------------ begin ---------------- | |
| (* | |
| The problem: lots of boilerplate code to make sure the exit code is being handled properly in our build script. | |
| when we have more steps, the code will smell worse. | |
| *) |
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
| // extend a type from another assembly with 'combine' | |
| type List<'a> with | |
| static member combine (f, x: List<'a>) : List<'a> = x @ [f] | |
| // extend another type from another assembly with 'combine' | |
| type System.Int32 with | |
| static member combine (f, x: System.Int32) = x + f | |
| // extend a type from this assembly with 'combine' |
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 inject (handler : 'dep -> (HttpContext -> Task<HttpContext option>) -> (HttpContext -> Task<HttpContext option>)) next ctx = | |
| let services = ctx.RequestServices | |
| let dependency = services.GetRequiredService<'dep>() | |
| handler dependency next ctx |
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 VList = | |
| open System | |
| open System.Collections.Generic | |
| open FSharp.NativeInterop | |
| open System.Runtime.CompilerServices | |
| open System.Runtime.InteropServices | |
| open System.Threading | |
| [<Struct>] |
NewerOlder