dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
589 stars 52 forks source link

Add support for F# 8.0 features #1366

Open Jand42 opened 7 months ago

Jand42 commented 7 months ago

New language/FSharp.Core features: (See Announcing F# 8)

Tarmil commented 7 months ago

I don't think while! needs new proxies actually: it is desugared into a combination of existing methods Bind, While, and mutable variables. Ie an expression like

while! cond do
    action

is desugared as if it was written

let! x = cond
let mutable x' = x
while x' do
    action
    let! x = cond
    x' <- x
Jand42 commented 7 months ago

@Tarmil Thanks! Indeed, TDD would have discovered this, I skipped testing while! for some reason while I checked what try-with within seq{} does. I have seen comparing methods in RuntimeHelpers that we also miss EnumerateFromFunctions, but I can't see in dotnet/fsharp where it's actually used yet... maybe deprecated?