Jordan Marr
@jordanmarr.bsky.social
340 followers 180 following 81 posts
Spreading the gospel of F# https://github.com/JordanMarr
Posts Media Videos Starter Packs
Long files in F# don’t bother me. But I am always open to the idea of refactoring if it makes sense.

One thing i hate in most C# codebases is having code split between so many files.

F# makes it easier to have less files which I think is usually better.
I think that you generally do want to keep the view stuff in the view fn rather than in the update fn. However, I have become more pragmatic over the years, and Elmish does include Cmds / effects for a reason.

Also, I don’t want to clutter my model with transient toast message mechanisms.
I see toasts as a feedback mechanism to make the page more responsive. They are transient and not necessarily part of a requirement.

OTOH, I add less transient results to the model, like for example an ImportSummary. Usually results that are part of a requirement or that I want to test.
Your thread inspired me to create a blog post on the subject.
Hopefully it helps!

bsky.app/profile/jord...
I think you chose a good path using Fable-to-TS. Bindings are a tradeoff that I think *can* be worth it for FT, long term projects if you don’t mind occasionally adding here and there as needed. But as always - it just depends.
Maybe Glutinum can get it close enough for Claude to take over?
I test my Fable Elmish logic on the. NET side.
FSharp.SystemComandLine v2.0.0-beta7 is released!

This adapts to API changes in the new System.CommandLine v2.0.0-beta7.
#fsharp

github.com/JordanMarr/F...
I just refactored a bunch of tests with large, inline JSON strings to files using the awesome "EasyBuild.FileSystemProvider" type provider by @mangelmaxime.bsky.social. #fsharp

(The JSON strings were using up mah tokens!)

github.com/easybuild-or...
No matter how many times I do it, I can never remember the sequence of git commands and cryptic arguments needed to sync my commits to an upstream repository over time. This has probably become my most repeated AI chat request.
Here is an excerpt from CC's `init` generated markdown summary:

Key Patterns:
Functional Core, Imperative Shell: F# domain logic with C# AutoCAD adapters
Domain-Driven Design: Rich domain models with business logic encapsulated
Immutable transformations: Raceway modifications return new instances
I totally agree. Claude Code has been amazing with F#.
Creating a spec to modify domain code can be an added layer of indirection, and is less precise than just writing the code.
F# domain logic is so expressive that it is a spec unto itself. This is evidenced by how well CC summarized my project.
Reposted by Jordan Marr
Look ma' no esbuild, no cdn, and somewhat editor tooling support! (you wouldn't believe how much the tooling "just works" when your dependencies are stored in a "node_modules" directory)

#dotnet #fsharp #webdev #spa #importmaps
Cool! How did you work around the directives? Which project was it?
Funny enough, I considered using the FS+ lenses recently until I noticed the Fable target had been commented out. (Which of fine since I ultimately decided against using lenses anyway.)
I think the the maintainer should do whatever they think is best for the project. People have the option to use an older version or fork it.
OTOH, dropping targets will likely cause consternation for some users.
I saw this recently in a project that dropped support for netstandard (for no reason).
The new `tryParse` fn in FSharp.SystemCommandLine makes it easy to parse any input type using the F# Result type for built-in validation. Perfect for parsing discriminated unions, or... anything. #fsharp
I haven’t used the free version, but the paid version w/ Claude 4 Sonnet is awesome.
Hallucinations are pretty rare IME.
It sounds like you are giving very general instructions because you are unfamiliar with the front end space. For this reason, I do think Fable -> TS will yield the best results.

Also, +1 to Claude Code over Copilot.
The third party devs helping me on a large F#/C# codebase have learned on-the-fly with the help of AI and zero coaching from me.
That may be the best of both worlds because you have type safety, and still have the ability to create complex logic in F# that you can call from TS.
But, I really enjoy using Fable so I could go either way.
(3/3)
With that said, you can also have Fable compile to TS which would allow you to generate your shared types as well as any complex logic that you want to share with the front end. Then your AI can do its thing with TS and still utilize your F# > TS code. (2/3)