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
| open System.Text.Json | |
| [<RequireQualifiedAccess>] | |
| module Json = | |
| [<return: Struct>] | |
| let inline private (|OfKind|_|) kind (json : JsonElement) = | |
| if json.ValueKind = kind then ValueSome json else ValueNone | |
| let (|Null|_|) json = | |
| match json with |
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
| using System.ComponentModel; | |
| using System.Diagnostics; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Runtime.CompilerServices; | |
| using System.Threading.Channels; | |
| /// <summary> | |
| /// Specifies relaxations for channel operation that can improve performance when adhered to. | |
| /// </summary> | |
| [Flags] |
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
| namespace Gist | |
| type Ctx<'a, 'b>(a: 'a, b: 'b) = | |
| member _.A = a | |
| member _.B = b | |
| type Ctx<'a>(a: 'a) = | |
| member _.Create<'t>(t: 't) = Ctx<'a, 't>(a, t) | |
| [<Struct>] |
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
| #r "nuget: Octokit" | |
| open Octokit | |
| open System | |
| open System.IO | |
| open System.Text.RegularExpressions | |
| // Configuration | |
| type Config = { | |
| Token: string | |
| RepoUrl: string |
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 ErrorMerging | |
| open FsToolkit.ErrorHandling | |
| (* Regular approach with two distinct error types *) | |
| type SensorReadings = int | |
| type EngineError = | |
| | Overheated |
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
| #if INTERACTIVE | |
| #r "nuget: FsToolkit.ErrorHandling" | |
| #endif | |
| open System.Text.Json | |
| open FsToolkit.ErrorHandling | |
| /// All Error DUs should implement this to "take part" in generalised fault reporting. | |
| [<Interface>] | |
| type IFault = |
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
| // | |
| // For users of Bundler & Minifier 2022+ | |
| // https://marketplace.visualstudio.com/items?itemName=Failwyn.BundlerMinifier64 | |
| // | |
| // Check to see if output and input files in bundleconfig.json exist. | |
| // | |
| open System | |
| open System.IO | |
| open System.Text |
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
| open System | |
| open System.Text.RegularExpressions | |
| let (|Lower|) (s: string) = s.ToLower() | |
| let (|LowerInvariant|) (s: string) = s.ToLowerInvariant() | |
| let (|Upper|) (s: string) = s.ToUpper() | |
| let (|UpperInvariant|) (s: string) = s.ToUpperInvariant() | |
| let (|Trim|) (s: string) = s.Trim() | |
| let (|TrimChars|) (chars: char array) (s: string) = s.Trim(chars) |
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
| namespace pblasucci.FaultReport | |
| /// Minimal contract provided by any failure. | |
| [<Interface>] | |
| type IFault = | |
| /// An unstructured human-readable summary of the current failure. | |
| abstract Message : string | |
| /// An optional reference to the failure which triggered the current failure | |
| /// (n.b. most failure do NOT have a cause). |
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
| #r "nuget: FSharp.Compiler.Service" | |
| open FSharp.Compiler.Syntax | |
| open FSharp.Compiler.SyntaxTrivia | |
| open FSharp.Compiler.Xml | |
| type Node = | |
| { Data : Data | |
| Children : Node list } |
NewerOlder