[EPIC] F# Code Generation Backend
- Dominant language
- F#
- Stars
- 14
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Implement a complete F# code generation backend for morphir-dotnet that transforms Morphir IR (JSON) into idiomatic, type-safe F# code using Fabulous.AST and Fantomas.
## Vision
Enable developers to generate production-ready F# code from Morphir IR, eliminating manual translation and maintaining type safety throughout the business logic transformation.
## Goals
- ✅ Generate idiomatic F# code from Morphir IR v3
- ✅ Support all Morphir type and value constructs
- ✅ Map Morphir SDK types to F# built-in types
- ✅ Integrate with `morphir gen fsharp` CLI command
- ✅ Auto-format output using Fantomas
- ✅ Support JSON codecs and lens generation (optional)
- ✅ Achieve ≥80% test coverage
- ✅ AOT-compatible generated code
## Success Metrics
- All Morphir IR v3 constructs generate valid F# code
- Generated code compiles without errors
- Performance: < 5s for 1000 types
- Test coverage ≥ 80%
- At least 3 example projects using the backend
## Related Documentation
- [PRD: F# Backend](https://github.com/finos/morphir-dotnet/blob/main/docs/design/PRD-fsharp-backend.md)
- [Design README](https://github.com/finos/morphir-dotnet/blob/main/docs/design/README-fsharp-backend.md)
- [Maturity Milestones](https://github.com/finos/morphir-dotnet/blob/main/docs/design/fsharp-backend-maturity-milestones.md)
- [GitHub Issues Template](https://github.com/finos/morphir-dotnet/blob/main/docs/design/github-issues-fsharp-backend.md)
## Child Issues
- [x] #364 Phase 0: Morphir.SDK F# Library Implementation
- [ ] #365 Phase 1: Foundation - Project Setup and Fabulous.AST Exploration
- [ ] #366 Phase 2: Type Mapping - Morphir IR Types → F# Types
- [ ] #367 Phase 3: Value Mapping - Morphir IR Values → F# Functions
- [ ] #368 Phase 4: CLI Integration - `morphir gen fsharp` Command
- [ ] #369 Phase 5: SDK Translation - Morphir SDK → F# Standard Library
- [ ] #370 Phase 6: Advanced Features - JSON Codecs and Lenses
- [ ] #372 Phase 7: Testing and Documentation
- [ ] #371 Phase 8: Release Preparation
## Dependencies
- Fabulous.AST v1.9.0+ (already in Directory.Packages.props)
- Fantomas.Core v7.0.5+ (already in Directory.Packages.props)
- Morphir.IR.Pipeline (transformation infrastructure)
- Morphir.SDK (F# runtime library - #364)
## Timeline
**Total Duration**: 13 weeks (1 week Phase 0 + 12 weeks implementation)
**Target Completion**: Q2 2025
Contributor guide
Assessment
This issue has not been assessed yet.