Skip to content

Instantly share code, notes, and snippets.

View gist:a3a0f573b7d6ebb1face0e7698fb9fb3
namespace FSComp
type internal SR =
private new : unit -> SR
static member
ArgumentsInSigAndImplMismatch : a0:System.String * a1:System.String ->
int * string
static member
CallerMemberNameIsOverriden : a0:System.String -> int * string
static member
dsyme / gist:bfed2eed788c7ba58ccc
Last active Dec 2, 2020
Naked type aliases can add and name constraints
View gist:bfed2eed788c7ba58ccc
// This F# language suggestion wants a way to name collections of constraints:
// 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
View gist:93d07b2cecde3d7470c1a8628a06669b
type NeuralStyles(C: Int, H: Int, W: Int) =
    inherit Model()

    let instance_norm (channels: Int, h, w) = 
        model { 
            let! shift = Weight.uniform (Shape [| channels; h; w |], 0.0)
            and! scale = Weight.uniform (Shape [| channels; h; w |], 1.0)
            return (fun input  ->
View gist:81a5f51ecc18261b226abad83e6a0ed7
open System
type T() =
member this.Item
with get ([<ParamArray>] indices: int[]) = "_"
and set ([<ParamArray>] indices: int[]) (value: string) = ()
let t = T()
// Works correctly
printfn "%A" t.[2, 1, 0]
View gist:1b28a65cddf82aae10ac87eacf73943a
class='parameter'>recordType</span></dt><dd><p>The type of record to construct.</p></dd><dt><span class='parameter'>bindingFlags</span></dt><dd><p>Optional binding flags.</p></dd></dl><p class='returns'><p>Returns: A function to construct records of the given type.</p><table class='inner-list exception-list'><tr><td><a href=\"\">ArgumentException</a></td><td>Thrown when the input type is not a record type.</td></tr></table>"
"uri": "",
"title": "FSharpValue.PreComputeRecordConstructorInfo",
"content": "FSharpValue.PreComputeRecordConstructorInfo \nPreComputeRecordConstructorInfo \n<p class='summary'>Get a ConstructorInfo for a record type</p><dl><dt><span class='parameter'>recordType</span></dt><dd><p>The record type.</p></dd><dt><span class='parameter'>bindingFlags</span></dt><dd><p>Optional
View gist:dc86bf86de81b83b75557d4944db43c2
1. tokenization
2. parsing
3. checking and elaboration (i.e. producing TypedTree)
- $" " plain
- $"..." as FormattableString
View gist:b487c1aeccb7dab7ffa2e9fe7932f4eb


Fyro Models

An Fyro model is an F# definition of the form:

let model (param1, .... paramN) = <distribution-expression>
View gist:dc915304b432be45d4b5e23d9a64cecf
This file has been truncated, but you can view the full file.
TryDownloadDotnetFrameworkSdk -- Test-IsAdmin = 'True'
pre-dl snPathX86Exists : True - 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe'
set WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools
set WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64
Build started 23/07/2020 16:13:52.
1>Project "C:\Users\dsyme\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20364.3\tools\Build.proj" on node 1 (default targets).
1>Project "C:\Users\dsyme\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20364.3\tools\Build.proj" (1) is building "C:\Users\dsyme\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20364.3\tools\Tools.proj" (2) on node 1 (Restore target(s)).