Problem Statement
Working with Typemail'''s type system is confusing due to unclear distinctions between Section.t, Element.t, and when/how to convert between them. Error messages don'''t clearly indicate what'''s expected or how to fix type mismatches.
Specific Pain Points
- Type hierarchy confusion: Unclear when to use
Section.t vs Element.t, and how they relate
- Composition errors: Error messages like "expected Element.t but got Section.t" don'''t explain how to convert or what went wrong
- API inconsistency:
Section.v vs Section.make have different type signatures but similar purposes, unclear when to use which
- Element conversion: No clear guidance on how to properly convert between different element types
Impact
- Steep learning curve for new users
- Trial-and-error development to understand type system
- Difficult to debug type errors in complex email templates
- Unclear API design increases development time
Context
During email template refactoring, multiple compilation errors due to type mismatches. Error messages didn'''t indicate whether conversion was needed, how to convert, or what the actual type hierarchy is. This suggests the type system could be more self-documenting.
Problem Statement
Working with Typemail'''s type system is confusing due to unclear distinctions between
Section.t,Element.t, and when/how to convert between them. Error messages don'''t clearly indicate what'''s expected or how to fix type mismatches.Specific Pain Points
Section.tvsElement.t, and how they relateSection.vvsSection.makehave different type signatures but similar purposes, unclear when to use whichImpact
Context
During email template refactoring, multiple compilation errors due to type mismatches. Error messages didn'''t indicate whether conversion was needed, how to convert, or what the actual type hierarchy is. This suggests the type system could be more self-documenting.