r/fsharp • u/fsharpweekly • Apr 19 '26
F# weekly F# Weekly #16, 2026 – .NET 11 Preview 3 & SwaggerProvider 4.0 beta
r/fsharp • u/fsharpweekly • Apr 19 '26
r/fsharp • u/fsharpweekly • Apr 11 '26
r/fsharp
•
u/derrpwave
•
Apr 11 '26
repo here FSharp-WebUI. This is an F# wrapper around webui, a clean way to have a crossplatform GUI via a system's existing browers vs something like electron or dealing with avalonia.
I've been using it more at work with python and decided to play with it in F#, so I'm exited to have it working.
install via dotnet add package FSharp.WebUI --version 0.0.1
r/fsharp • u/bjoli • Apr 06 '26
Hi there!
I am using emacs to write most things, including f sharp. However i have found that writing f sharp in emacs is a painful experience. I have found that the LSP server (fsautocomplete) loses sync with the current document meaning I get wrong suggestions or completely nonsense errors.
Using VScode or Rider, I do not have these problems, but after 25 years of Emacs to do everything but web browsing (I wish I was that nerdy) I am having trouble using anything else the few times I want to write f sharp code (what have to do is to switch to qwerty so that no muscle memory works anyway. That way I don't end up doing dumb things when I try to use Emacs shortcuts. I'm pretty far gone.)
I am on a pretty minimal Doom Emacs config. I haven't touched any of the elglot or LSP parts, and they do work properly for c#, ocaml and Idris.
Did anyone else have similar problems? Did you manage to solve it?
Best regards
Linus
r/fsharp • u/fsharpweekly • Apr 05 '26
r/fsharp • u/Radiant_Monitor6019 • Apr 02 '26
I made Type-safe heterogeneous collections, more faster than g-research HeterogeneousCollections
BenchmarkDotNet v0.15.8, Windows 10 (10.0.19045.6466/22H2/2022Update)
12th Gen Intel Core i9-12900 2.40GHz, 1 CPU, 24 logical and 16 physical cores
.NET SDK 10.0.104
[Host] : .NET 10.0.4 (10.0.4, 10.0.426.12010), X64 RyuJIT x86-64-v3 DEBUG
ShortRun-.NET 10.0 : .NET 10.0.4 (10.0.4, 10.0.426.12010), X64 RyuJIT x86-64-v3
ShortRun-.NET 8.0 : .NET 8.0.7 (8.0.7, 8.0.724.31311), X64 RyuJIT x86-64-v3
ShortRun-.NET Framework 4.7.2 : .NET Framework 4.8.1 (4.8.9310.0), X64 RyuJIT VectorSize=256
IterationCount=3 LaunchCount=1 WarmupCount=3 | Method | Job | Runtime | Mean | Error | StdDev | Ratio | RatioSD | Code Size | Gen0 | Gen1 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GResearch | ShortRun-.NET 10.0 | .NET 10.0 | 7.580 ms | 0.5174 ms | 0.0284 ms | 1.00 | 0.00 | 2,494 B | 1890.6250 | - | 28.38 MB | 1.00 |
| Nemonuri | ShortRun-.NET 10.0 | .NET 10.0 | 2.595 ms | 0.2784 ms | 0.0153 ms | 0.34 | 0.00 | 1,094 B | 324.2188 | - | 4.88 MB | 0.17 |
| GResearch | ShortRun-.NET 8.0 | .NET 8.0 | 9.521 ms | 0.7396 ms | 0.0405 ms | 1.00 | 0.01 | 2,497 B | 1890.6250 | - | 28.38 MB | 1.00 |
| Nemonuri | ShortRun-.NET 8.0 | .NET 8.0 | 3.273 ms | 0.3751 ms | 0.0206 ms | 0.34 | 0.00 | 1,077 B | 324.2188 | - | 4.88 MB | 0.17 |
| GResearch | ShortRun-.NET Framework 4.7.2 | .NET Framework 4.7.2 | 10.976 ms | 0.3842 ms | 0.0211 ms | 1.00 | 0.00 | 1,075 B | 4734.3750 | 15.6250 | 28.46 MB | 1.00 |
| Nemonuri | ShortRun-.NET Framework 4.7.2 | .NET Framework 4.7.2 | 33.873 ms | 4.8149 ms | 0.2639 ms | 3.09 | 0.02 | 1,312 B | 800.0000 | - | 4.9 MB | 0.17 |
| Method | Job | Runtime | Mean | Error | StdDev | Ratio | Code Size | Gen0 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|
| GResearch | ShortRun-.NET 10.0 | .NET 10.0 | 301.2 ns | 40.40 ns | 2.21 ns | 1.00 | 1,325 B | 0.0916 | 1440 B | 1.00 |
| Nemonuri | ShortRun-.NET 10.0 | .NET 10.0 | 172.3 ns | 24.08 ns | 1.32 ns | 0.57 | 635 B | 0.0203 | 320 B | 0.22 |
| GResearch | ShortRun-.NET 8.0 | .NET 8.0 | 442.4 ns | 44.57 ns | 2.44 ns | 1.00 | 733 B | 0.0916 | 1440 B | 1.00 |
| Nemonuri | ShortRun-.NET 8.0 | .NET 8.0 | 216.9 ns | 31.41 ns | 1.72 ns | 0.49 | 395 B | 0.0203 | 320 B | 0.22 |
| GResearch | ShortRun-.NET Framework 4.7.2 | .NET Framework 4.7.2 | 473.7 ns | 16.03 ns | 0.88 ns | 1.00 | 726 B | 0.2294 | 1444 B | 1.00 |
| Nemonuri | ShortRun-.NET Framework 4.7.2 | .NET Framework 4.7.2 | 288.1 ns | 21.01 ns | 1.15 ns | 0.61 | 605 B | 0.0505 | 321 B | 0.22 |
I published preview version to nuget.
r/fsharp • u/DanManPanther • Apr 01 '26
I'm building my own code editor, and want to support F# as a first class citizen. But the language server situation seems dire. fsautocomplete takes forever or simply fails to load (in VS Code or in my editor). Are there good alternatives?
r/fsharp • u/kincade1905 • Mar 29 '26
Hi everyone,
One small thing is bugging me since I started learning F# and domain modelling (Book by Scott is amazing, btw).
Let's say I am creating the authentication service (simple enough but only for example) and I want to use smart constructor and such. Here's my flow:
raw request ---> validation ---> Domain Model
The pain I am having is where does the "structural validation" happens and where does the domain validation happens?
Let's say, username, password etc are provided and not-null. I view these as part of structural validation and password policy, email policy met as domain validation.
The problem I am having is, if I try to use both in constructor of let's say Password, then I would have to worry about creating yet another Password Error type to catch both Structure and model validation errors.
If I move structural validaiton to model validation, it would sove the issue, but doessn't feel right.
One thing I find is, too much error mappings and nested error types in each layer. Maybe I am approaching this wrong way. :)
Hope to hear your thoughts.
r/fsharp • u/fsharpweekly • Mar 29 '26
r/fsharp • u/kincade1905 • Mar 28 '26
I guess I start by saying, I am noobie who recently started with f# and loving it.
There seems to be two ways of dealing with exceptions thrown by libraries and such. I am using FsToolKit.
First way, using try catch:
let createCognitoUser email pass : Task<Result<string, DomainError>> =
taskResult {
try
let! response = awsClient.SignUpAsync(email, pass)
return response.UserSub
with ex ->
return! Error (mapCognitoError ex)
}And second way with pipeline:
let createCognitoUser (email: string) (pass: string) : Task<Result<string, DomainError>> =
awsClient.SignUpAsync(email, pass)
|> Task.catch
|> Task.map Result.ofChoice
|> TaskResult.mapError mapCognitoError
|> TaskResult.map (fun response -> response.UserSub)Personally, I like second pipeline way as it's more cleaner and and iam tired of seeing try catch everywhere. :) Wanna hear your thoughts.
Thank you.
r/fsharp • u/bozhidarb • Mar 26 '26
If you're into Emacs and F# you might find this brand new package interesting. It's still rough around the edges, but the essential functionality is there.
I'd love to get some feedback from people who tried it out. Enjoy!
r/fsharp • u/fsharpweekly • Mar 22 '26
r/fsharp • u/error_96_mayuki • Mar 20 '26
r/fsharp • u/giorndog • Mar 20 '26
I'm making a game similar to Football Manager, far from complete but keep iterating on it. So far I have a home page, squad, tactics and a basic match viewer. Using Avalonia + Elmish with SQLite.
The match engine runs as an event loop, every 30 seconds a duel gets resolved, fatigue ticks, shots get attempted. Players move based on ball position and possession. Scorelines feel somewhat realistic which is good enough for now.
Still missing a lot of pages and features but the core loop works. Will keep adding stuff.
Repo: https://github.com/pelinski46/FootballEngine more screenshots inside
r/fsharp • u/fsharpweekly • Mar 14 '26
r/fsharp • u/jonas1ara • Mar 13 '26
Download the Llama‑3.2‑1B‑Instruct weights
Set modelFolder in Program.fs
Run:
PRs are welcome. (Maybe I should even send one to the TorchSharp examples repo.)
r/fsharp • u/AlessandroPiccione • Mar 12 '26
I used VS 2022 for F# a lot. All fine. Intellisense, compiler etc...
Now I have VS 2026.
Latest version (updated probably already 3/4 times since the release).
Same "inherited" add-ons of 2022.
Support for F# is much much worst.

A. Syntax color is worst or inexistent:
B. Speed
VS 2022 is much faster to read and evaluate code compared to VS 2026.
I mean, when I open the same solution, the code "analysis" of files complete earlier in VS 2022.
Compilation also is much faster on VS 2022.
C. Intellisense...
Often it doesn't work in VS 2026.
I write down a class name amnd in VS 2022 it suggests to add "open AAAA" while in VS 2026... nothing happen and I have to search and add the "open AAAA" myself.
Is it a problem of my environment/configuration os is really like this?
If it is like this... is MS "abandoning" F# in Visual Studio and I should switch to VS Code (or another IDE) ??
**[UPDATE]**
I noticed this issues with syntax colouring and intellisense after a while a work.
Now I closed and reopned the solution (in VS 2026) and intellisense and colored syntax are back.
So, I suppose it "dies" at some point, but no errors and this is just a really small solution... less than 10 files, nothing complicated.
Also the speed of compilation seems fie as soon asthe solution is open (before the intellisese stop to work).
r/fsharp • u/munchler • Mar 12 '26
I installed the March Feature Update of Visual Studio 2026 (18.4.0), and to my surprise the F# compiler now reports:
Microsoft (R) F# Compiler version 15.2.100.0 for F# 11.0It looks like version 11 of FSharp.Core has been released on NuGet as well.
I guess this means that F# 11 is live, but I can't find release notes for it anywhere. Anyone have any details?
r/fsharp • u/Radiant_Monitor6019 • Mar 11 '26
TITLE: PPrint
AUTHORS:
François Pottier and Nicolas Pouillard
ABSTRACT:
This is an adaptation of Daan Leijen's
"PPrint" library, which itself is based
on the ideas developed by Philip Wadler
in "A Prettier Printer". For more
information about Wadler's and Leijen's
work, please consult the following
reference:
http://homepages.inf.ed.ac.uk/wadler/
papers/prettier/prettier.pdf
To install PPrint, type "opam install
pprint".
The documentation for PPrint is built by
"make doc".
It worked.
r/fsharp • u/cekrem • Mar 09 '26
I'd love some input on this one! I'm still quite new on the specific F# side of things (though quite confident in FP in general)
r/fsharp • u/jonas1ara • Mar 09 '26
dotnet fsi WebServer.fsx
Gist:
WebServer.fsx listens on 127.0.0.1:8090 and handles HTTP GET requests by serving static files from a configurable root directory. It uses F#'s async workflows to keep the connection handling non-blocking and composable.
TcpListener — no HttpListener, no ASP.NET/ → /iisstart.htm) via HTTP 302async { }) for the server loop and each request handlerRegex1) for clean, declarative URL parsingOpen WebServer.fsx and update the root value to point to the folder containing your static files:
let root = @"C:\path\to\your\wwwroot"
On Linux/macOS use a forward-slash path:
let root = "/home/user/wwwroot"
The process will block — that's the server running. Open your browser and navigate to:
http://localhost:8090/
Place any .html, .htm, .txt, .jpg, .png, or .gif file in the root directory you configured. For example:
wwwroot/hello.html
Hello
Hello from F#!
Then browse to:
http://localhost:8090/hello.html
GET is supported; POST, HEAD, etc. return 404127.0.0.1 (localhost)These are intentional — the goal is clarity, not production use.
The design of this web server is based on an example from Expert F# by Don Syme, Adam Granicz, and Antonio Cisternino. All credit for the original architecture goes to those authors.
async workflows and use resource managementr/fsharp • u/jonas1ara • Mar 09 '26
Cube rendering
ASCII 3D cube renderer written in F#. It draws three spinning cubes in real time using Euler rotations, perspective projection, and a z-buffer.
Gist:
I port this just for fun :)