Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 791 Bytes

primitives.md

File metadata and controls

11 lines (9 loc) · 791 Bytes

Adding a new primitive type to Primer

See the commit where we added Int for an example.

  • Add a constructor to PrimCon.
    • Follow GHC's warnings to everywhere else that needs updating (textual name, tree rendering, type def).
  • Add any desired primitive functions (technically values, but we're yet to have a use case for one without arguments) involving that type to allPrimDefs.
    • For each such function, add at least one test in Tests.EvalFull.
    • Adding a helper in Primer.Core.DSL (like char, int) may help with writing these functions.
  • Add a case to the serialization outputs, with the new constructor.
  • Some old tests may need IDs modified, due to the set of in-scope global variables having changed.