Formatting F# Code, There and Back Again
summary
A practical report on an F# code formatter that actually runs: Fantomas parses source via FSharp.Compiler.Service, builds an AST plus token trivia to preserve comments and strings, and rewrites code as a source-to-source tool and CLI. It integrates as a daemon for editors, raised unit tests from ~300 to ~2,000, formats most real projects but once corrupted an FSharp.Data file and required a .fantomasignore, offers an online Azure-backed formatter that files GitHub issues, and is sponsored by G‑Research while aiming to format the F# compiler (11k lines took 10 minutes).
AI-written summary · about
chapters (22)
- 0:00Introduction to formatting
- 1:19Philosophy of code styling
- 2:39What is code formatting?
- 5:05F# formatting challenges
- 7:11Phantomous project history
- 9:00Mentorship and maintenance
- 12:58Phantomous in action
- 17:05Handling formatting errors
- 20:22Reporting bugs
- 23:37Technical implementation
- 28:49Formatting settings
- 32:00Community contributions
- 34:51The F# style guide
- 38:22Sponsorship and industry
- 40:42Future releases and daemon
- 43:25Editor integration demo
- 46:50CI/CD integration
- 48:53The endgame: compiler core
- 52:53Performance improvements
- 55:22Phantomous 5 roadmap
- 57:45Code generation demo
- 59:12Q&A and conclusion








