Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for F# 8.0 features #1366

Open
14 of 15 tasks
Jand42 opened this issue Dec 1, 2023 · 2 comments
Open
14 of 15 tasks

Add support for F# 8.0 features #1366

Jand42 opened this issue Dec 1, 2023 · 2 comments

Comments

@Jand42
Copy link
Member

Jand42 commented Dec 1, 2023

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

  • Update to FSharp.Compiler.Service 43.8.100
  • _.Property shorthand (should be handled by FCS without AST change)
    • Tests added
  • Nested record field copy and update (should be handled by FCS without AST change)
    • Tests added
  • while! - syntax sugar handled by FCS, uses already existing Bind+While methods
    • Tests added
  • Extended string interpolation syntax - multiple $ now marks multiple { } needed. String interpolation macro needs to be updated
    • Tests added
  • Use and compose string literals for printf and related functions (probably handled by FCS and we can extract string literal the same way, needs to be tested)
    • Tests added
  • Arithmetic operators in literals - do we translate expression or compute literal? Both should work, but latter is optimal.
    • Tests added
  • Type constraint intersection syntax - type system upgrade, should have no effect on us, but add test to be sure
    • Tests added
  • Extended fixed bindings - WS has no support for fixed, it's just ignored
  • Easier [<Extension>] method definition - syntax upgrade to test
    • Tests added
  • Static members in interfaces - we already have support for same in C#, to bring over to F# ProjectReader
    • Tests added
  • Static let in discriminated unions, records, structs, and types without primary constructors - should be handled by FCS but needs test. All static lets are hoisted to run on module initialization by F# semantics anyways
    • Tests added
  • try-with within seq{},[] and [||] collection expressions - needs proxy for RuntimeHelpers.EnumerateTryWith and EnumerateFromFunctions
    • Tests added
@Tarmil
Copy link
Member

Tarmil commented Dec 1, 2023

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
Copy link
Member Author

Jand42 commented Dec 1, 2023

@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?

Jand42 added a commit that referenced this issue Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants