dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.82k stars 772 forks source link

Support empty-bodied computation expressions #17352

Open brianrourkeboll opened 3 days ago

brianrourkeboll commented 3 days ago

Description

Examples

builder { }
seq { }

Checklist

[!IMPORTANT] Shoutout to @edgarfgp @fabulous-dev for sponsoring my work on this.

github-actions[bot] commented 3 days ago

:heavy_exclamation_mark: Release notes required


:white_check_mark: Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/8.0.400.md
LanguageFeatures.fsi docs/release-notes/.Language/preview.md
vzarytovskii commented 3 days ago

Haven't reviewed it yet, but thinking out loud:

How would this play with resumable state machines. I assume it should be fine since it's just a transformation essentially.

And second, orthogonal comment - this feature will encourage more CE use, which my itself is not bad, but might lead to more nested CEs, which will involve more checking = being slower. We really need to do something with it. I made an attempt or two in the past, but change surface was bigger than I anticipated.

brianrourkeboll commented 3 days ago

How would this play with resumable state machines. I assume it should be fine since it's just a transformation essentially.

That's a good call-out. I'll add some tests to make sure.

psfinaki commented 3 days ago

/azp run

azure-pipelines[bot] commented 3 days ago
Azure Pipelines successfully started running 2 pipeline(s).
psfinaki commented 3 days ago

Cool stuff! Hope to give it a review soon. Can be a nice and intuitive addition to the language.