F# Coding Practices
Application skill for F# component design learning (from the archived awesome-guidelines style capsules). When targeting C# consumers, prioritize vanilla.NET API rules over F#-only idioms on the public surface.
Core Principle
F# library quality is audience-shaped APIs, F#-facing modules and unions internally, BCL-friendly types and delegates on cross-language boundaries.
When to Use / NOT
- F# libraries, SDKs, and shared
.fs components consumed by F# or other.NET languages.
- Setting up Fantomas, XML doc warnings,
.fsi for stable APIs, dotnet build/test in CI.
NOT when:
- Pure C# projects, use
csharp-coding-practices.
- Generated FSharp.Core dependents only, validate hand-written public API.
Workflow
- Names & docs,.NET casing,
/// XML, .fsi if stable (fsharp-style-naming-documentation.md).
- Modules & types, encapsulation, DUs, interfaces (
fsharp-style-modules-types.md).
- Functions & async, Async naming, extensions, constraints (
fsharp-style-functions-async.md).
- Interop, Func, IEnumerable, Task, null guards (
fsharp-style-dotnet-interop.md).
- Verify, Fantomas,
dotnet build, optional C# consumer compile check on public API.
Red Flags
- Public modules in cross-language NuGet libraries
- Exposed record/union cases on evolvable types
- Implementation inheritance for extension
- Custom symbolic operators without named API
- Public type abbreviations with wrong semantics
- SRTP/duck constraints on general consumer APIs
list/Map/option in vanilla.NET public signatures
- Curried or tuple-returning public methods for C# consumers
int -> int instead of Func<int,int> on public API
- Missing XML docs on exported members
- Overuse
[<AutoOpen>]
- No null checks at vanilla.NET boundaries
[<CLIEvent>] missing on public events
Verification
dotnet format / Fantomas check (project config)
dotnet build with XML documentation warnings as errors (if enabled)
- Reflect or C# snippet compile against public API
- Capsule checklist on F#-facing vs vanilla.NET audience
References
awesome-guidelines/references/fsharp-style-learning-note.md
awesome-guidelines/references/fsharp-style-naming-documentation.md
awesome-guidelines/references/fsharp-style-modules-types.md
awesome-guidelines/references/fsharp-style-functions-async.md
awesome-guidelines/references/fsharp-style-dotnet-interop.md
1---2name: fsharp-coding-practices3description: Use when authoring or reviewing F#,.NET naming, XML docs, module/type design, Async/Task boundaries, vanilla.NET interop (Func, IEnumerable, TryGetValue), and Fantomas/dotnet build in CI.4---56# F# Coding Practices78Application skill for F# component design learning (from the archived `awesome-guidelines` style capsules). When targeting C# consumers, prioritize vanilla.NET API rules over F#-only idioms on the public surface.910## Core Principle1112F# library quality is **audience-shaped APIs**, F#-facing modules and unions internally, BCL-friendly types and delegates on cross-language boundaries.1314## When to Use / NOT1516- F# libraries, SDKs, and shared `.fs` components consumed by F# or other.NET languages.17- Setting up Fantomas, XML doc warnings, `.fsi` for stable APIs, `dotnet build`/test in CI.1819**NOT when:**2021- Pure C# projects, use `csharp-coding-practices`.22- Generated FSharp.Core dependents only, validate hand-written public API.2324## Workflow25261. **Names & docs**,.NET casing, `///` XML, `.fsi` if stable (`fsharp-style-naming-documentation.md`).272. **Modules & types**, encapsulation, DUs, interfaces (`fsharp-style-modules-types.md`).283. **Functions & async**, Async naming, extensions, constraints (`fsharp-style-functions-async.md`).294. **Interop**, Func, IEnumerable, Task, null guards (`fsharp-style-dotnet-interop.md`).305. **Verify**, Fantomas, `dotnet build`, optional C# consumer compile check on public API.3132## Red Flags3334- Public modules in cross-language NuGet libraries35- Exposed record/union cases on evolvable types36- Implementation inheritance for extension37- Custom symbolic operators without named API38- Public type abbreviations with wrong semantics39- SRTP/duck constraints on general consumer APIs40- `list`/`Map`/`option` in vanilla.NET public signatures41- Curried or tuple-returning public methods for C# consumers42- `int -> int` instead of `Func<int,int>` on public API43- Missing XML docs on exported members44- Overuse `[<AutoOpen>]`45- No null checks at vanilla.NET boundaries46- `[<CLIEvent>]` missing on public events4748## Verification4950- `dotnet format` / Fantomas check (project config)51- `dotnet build` with XML documentation warnings as errors (if enabled)52- Reflect or C# snippet compile against public API53- Capsule checklist on F#-facing vs vanilla.NET audience545556## References5758- `awesome-guidelines/references/fsharp-style-learning-note.md`59- `awesome-guidelines/references/fsharp-style-naming-documentation.md`60- `awesome-guidelines/references/fsharp-style-modules-types.md`61- `awesome-guidelines/references/fsharp-style-functions-async.md`62- `awesome-guidelines/references/fsharp-style-dotnet-interop.md`