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
namespace blah_lib | |
module Say = | |
let hello name () = | |
printfn "Hello %s" name |
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
2 (3/4 lb) pork tenderloins | |
1/2 c soy sauce | |
1/3 c honey | |
1/4 c dry sherry | |
1/4 tsp garlic powder | |
1/4 tsp ground ginger | |
2 Tbsp dry mustard (sauce) | |
1/3 c sesame seeds, toasted |
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
#! /usr/bin/env zsh | |
# call like `devCompile <path to fsx> <other compiler flags>` | |
# note that I've got my locally-built compiler here for fsc.dll, for normal use you'd want to use the one from | |
# <SDK_ROOT>/FSharp/fsc.dll | |
function devCompile () { | |
file=$(realpath $1) | |
shift | |
base=$(basename $file .fsx) | |
/usr/local/share/dotnet/dotnet \ |
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
<!-- | |
If no PackageReadmeFile is present and there's a _PackageFiles with the metadata node `PackageReadmeFile="true"` set, | |
use its resolved PackagePath as the `PackageReadmeFile` | |
eg. <None Include="../../README.md" Pack="true" PackagePath="\" PackageReadmeFile="true" /> | |
--> | |
<Target Name="_SetPackageReadmeFileByConvention" | |
DependsOnTargets="_GetPackageFiles" | |
BeforeTargets="GenerateNuspec" | |
Condition="'$(PackageReadmeFile)' == ''"> |
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
{ | |
"editor.semanticTokenColorCustomizations": { | |
// note: the keys of this dictionary are your installed themes. you'll have to set these for each theme you want to override. | |
"[Default Dark+]": { | |
"enabled": true, | |
"rules": { | |
"member.mutable": { | |
"foreground": "#FF0000", | |
"fontStyle": "underline", | |
}, |
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
type AsyncOptionBuilder() = | |
member __.Return (value: 'T) : Async<Option<'T>> = | |
async { return Some value } | |
member __.ReturnFrom | |
(asyncResult: Async<Option<_>>) | |
: Async<Option<_>> = | |
asyncResult |
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> | |
<PropertyGroup> | |
<!-- Provide an escape hatch/opt-in to this feature --> | |
<AutoIncludeExistingSignatures Condition="$(AutoIncludeExistingSignatures) == '' " >false</AutoIncludeExistingSignatures> | |
</PropertyGroup> | |
<Target Name="CollectFSharpSourcesAndSignatures" BeforeTargets="CoreCompile" Condition="$(AutoIncludeExistingSignatures)"> | |
<ItemGroup> | |
<!-- Cache the current set of compile options --> | |
<_Sources Include="@(Compile)" /> | |
<!-- clear out the Compile order because we need to insert the sigs before their associated source files --> |
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
// You'll need to run this in a .net core sdk 3.1.300+ `dotnet fsi` instance, with the `--langversion:preview` flag set. | |
#r "nuget: FsCheck" | |
open FsCheck | |
(* type definitions *) | |
type Point = { x: int; y: int} | |
type Shape = | |
| Square of Point * Point * Point * Point | |
| Triangle of Point * Point * Point | |
| Circle of Point * int |
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
type Wrapper() = | |
let mutable _one = 0 | |
let mutable _two = 0 | |
member _.one | |
with get () = _one | |
and set (newValue: int) = | |
_one <- newValue | |
member _.two |
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 Auth | |
open Microsoft.AspNetCore.Authentication | |
open Microsoft.Extensions.Logging | |
open FSharp.Control.Tasks.V2.ContextInsensitive | |
open Giraffe | |
/// Authenticates the request against the given `schemes`. | |
/// If the request is authenticated, the authenticated identities are added to the current HTTP Context's User. | |
let authenticateMany (schemes: string seq): HttpHandler = |