Skip to content

Instantly share code, notes, and snippets.

@dsyme
dsyme / rant.md
Last active December 31, 2022 05:54
@dsyme
dsyme / gist:9b18608b78dccf92ba33
Last active November 1, 2022 18:11
Working self-contained getting-started sample for Suave Web Scripting
//==========================================
// Working fully self-contained getting-started example for Suave Web Server scripting
//
// Note you don't need to have _anything_ installed before starting with this script. Nothing
// but F# Interactive and this script.
//
// This script fetches the Paket.exe component which is referenced later in the script.
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been
// downloaded by the user (by executing the first part of the script) the reference
// shows as resolved and can be used.
public class Product
{
public string Name { get; set; }
public decimal Price { get; set; }
}
public class Trolley
{
public List<Product> Products { get; set; }
@dsyme
dsyme / args.txt
Last active August 19, 2022 19:19
-o:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\FSharp.Compiler.Service.dll
--debug:embedded
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\buildproperties.fs
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\FSComp.fs
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\FSIstrings.fs
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\UtilsStrings.fs
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\FSharp.Compiler.Service.AssemblyInfo.fs
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\illex.fs
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\pplex.fs
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Proto\netstandard2.0\lex.fs
open System
let transfers = [| Some 2,1 |]
let FetchInternalTransfers (includeConfirmeds: int) =
task {
let! mapPrioritiesTransfers =
task {
if includeConfirmeds > 1 then
This file has been truncated, but you can view the full file.
Cracking project options....
FSharpEmbedResourceText: Skipping generation of C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Compiler.Service\Debug\net472\FSComp.fs and C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Compiler.Service\Debug\net472\FSComp.resx from FSComp.txt since up-to-date
FSharpEmbedResourceText: Skipping generation of C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Compiler.Service\Debug\net472\FSIstrings.fs and C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Compiler.Service\Debug\net472\FSIstrings.resx from Interactive\FSIstrings.txt since up-to-date
FSharpEmbedResourceText: Skipping generation of C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Compiler.Service\Debug\net472\UtilsStrings.fs and C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Compiler.Service\Debug\net472\UtilsStrings.resx from Facilities\UtilsStrings.txt since up-to-date
Checking project....
Grouping symbol uses....
Type: FSharp.Compiler.TypedTree.TType
ty (2632 times)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2248,
Type: FSharp.Compiler.TypedTree.ValReprInfo
valReprInfo (159 times)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (1753,70--1753,81)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (1754,37--1754,48)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (2515,34--2515,45)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (2516,73--2516,84)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (2520,29--2520,40)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (2542,44--2542,55)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (2543,85--2543,96)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTreeOps.fs (2547,29--2547,40)
Cracking project options....
FSharpEmbedResourceText: Skipping generation of C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Build\Debug\netstandard2.0\FSBuild.fs and C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Build\Debug\netstandard2.0\FSBuild.resx from FSBuild.txt since up-to-date
FSharpEmbedResourceText: Skipping generation of C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Build\Debug\netstandard2.0\UtilsStrings.fs and C:\GitHub\dsyme\fsharp\artifacts\obj\FSharp.Build\Debug\netstandard2.0\UtilsStrings.resx from ..\Compiler\Facilities\UtilsStrings.txt since up-to-date
Checking project....
Grouping symbol uses....
Type: Microsoft.Build.Framework.ITaskItem
item (50 times)
C:\GitHub\dsyme\fsharp\src\FSharp.Build\FSharpCommandLineBuilder.fs (52,12--52,16)
C:\GitHub\dsyme\fsharp\src\FSharp.Build\FSharpCommandLineBuilder.fs (54,50--54,54)
C:\GitHub\dsyme\fsharp\src\FSharp.Build\Fsc.fs (142,12--142,16)
This file has been truncated, but you can view the full file.
Type: FSharp.Compiler.TypedTree.TType
ty (4303 times)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2248,12--2248,14)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2249,18--2249,20)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2254,15--2254,17)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2866,10--2866,12)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2866,20--2866,22)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2872,10--2872,12)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (2872,16--2872,18)
C:\GitHub\dsyme\fsharp\src\Compiler\TypedTree\TypedTree.fs (3001,21--3001,23)
@dsyme
dsyme / gist:bfed2eed788c7ba58ccc
Last active July 4, 2022 22:23
Naked type aliases can add and name constraints
// This F# language suggestion wants a way to name collections of constraints:
// http://fslang.uservoice.com/forums/245727-f-language/suggestions/8509687-add-constraints-as-a-language-construct
//
// This is a type alias X<T> = T, so X<int> = int etc.
type X<'T> = 'T
// This is a type alias X<T> = T which adds a constraint
type WithStruct<'T when 'T : struct> = 'T