Implementing New Types
1. Update the AST
data Type
= -- ... existing types ...
| TNewType -- Add your new type here
deriving (Show, Eq, Ord)2. Modify the Parser
parseType :: PU.Parser AT.Type
parseType = M.choice
[ -- ... existing choices ...
, parseNewType
]
parseNewType :: PU.Parser AT.Type
parseNewType = AT.TNewType <$ PU.symbol "newtype"3. Add Code Generation
4. Update Utility Functions
5. Add Tests
5. Update Documentation
Best Practices
Last updated