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
| // Use the Test solution configuration and now test cases will fail if they are using '=' on structs. | |
| #if STRUCT_EQ_CHECK | |
| [<AutoOpen>] | |
| #endif | |
| module StructEqCheck = | |
| type StructEqualityException() = | |
| inherit exn() | |
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
| // No early return | |
| // Prints "gotcha" | |
| async { | |
| return () | |
| printfn "gotcha" | |
| } | |
| |> Async.RunSynchronously | |
| // Early return | |
| // Does not print anything |
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
| // Experiment | |
| open System | |
| open System.Collections.Generic | |
| open System.Runtime.CompilerServices | |
| // Case-insensitive strings for ValueTuple embedding. | |
| [<IsReadOnly; Struct; CustomEquality; CustomComparison>] | |
| type OrdinalIgnoreCaseString = | |
| { Value: 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
| <Query Kind="FSharpProgram"> | |
| <NuGetReference>Avalonia</NuGetReference> | |
| <NuGetReference>Avalonia.Desktop</NuGetReference> | |
| <NuGetReference>Avalonia.Themes.Fluent</NuGetReference> | |
| <NuGetReference>Vide.UI.Avalonia</NuGetReference> | |
| <Namespace>Avalonia</Namespace> | |
| <Namespace>Vide</Namespace> | |
| <Namespace>Vide.UI.Avalonia</Namespace> | |
| </Query> |
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.Diagnostics | |
| open System.Runtime.CompilerServices | |
| open System.Runtime.InteropServices | |
| let activitySource = new ActivitySource("Test") | |
| [<IsReadOnly; Struct>] | |
| type Trace<'T>(activitySource: ActivitySource) = | |
| static let typeName = typeof<'T>.Name |
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
| // Experiment. | |
| // | |
| // If I have a combination of optional types, and want to operate on them | |
| // it is tedious to have to pick the right functions based on precise | |
| // option type, rather than just do a "flatten this value, I don't care | |
| // which combination of Option<_> or ValueOption<_> it is - just make it happen!" | |
| // | |
| // So: | |
| // Mix and match Option<_> and ValueOption<_> | |
| // Results are Option<_> |
OlderNewer