From left to right, a forked constructor family enters a faceted reflection aperture and a braced primitive-atom selector; below, a checked return, a closed mock loop, and an open circuit to an external plug distinguish the macro's three execution modes.
Unsafe primitive-atom family macro and chooser

ff-generics-unsafe

repository URL pending

Scope

ff-generics-unsafe provides an execution-enabled extension to generic programming over primitive atoms in Agda. It builds on ff-generics and ff-json to turn generic descriptions into JSON-mediated values during typechecking. The Macro module covers interactive and source-oriented value choice, including certified paths and mocked invocation modes. FamilyMacro uses reflection to inspect constructors and fields and to synthesize machinery for related datatype families. The examples and mock tests exercise sums, records, recursive families, and combinations of string, natural-number, integer, and Boolean fields.

Most important results

Runtime-backed macros can invoke a Node.js chooser during elaboration and decode its JSON response into a value described by Generic PrimAtoms. Parallel source modes ask Agda to typecheck generated source before accepting it, while mock modes make the same boundary reproducible without launching the interface. Family reflection derives datatype descriptions, constructor names, encoders, decoders, and both directions of the round-trip property for a related set of declarations. The checked examples establish definitional equalities for decoded mocks across constructors, records, certified generics, and mixed primitive fields.

Library modules

7 checked modules

Select a module to inspect its generated Agda source view.

Skip to content

Agda libraries

ff-generics-unsafe

ff-generics-unsafe provides an execution-enabled extension to generic programming over primitive atoms in Agda.

Unsafe primitive-atom family macro and chooserFrom left to right, a forked constructor family enters a faceted reflection aperture and a braced primitive-atom selector; below, a checked return, a closed mock loop, and an open circuit to an external plug distinguish the macro's three execution modes.
From left to right, a forked constructor family enters a faceted reflection aperture and a braced primitive-atom selector; below, a checked return, a closed mock loop, and an open circuit to an external plug distinguish the macro's three execution modes.

Scope

ff-generics-unsafe provides an execution-enabled extension to generic programming over primitive atoms in Agda. It builds on ff-generics and ff-json to turn generic descriptions into JSON-mediated values during typechecking. The Macro module covers interactive and source-oriented value choice, including certified paths and mocked invocation modes. FamilyMacro uses reflection to inspect constructors and fields and to synthesize machinery for related datatype families. The examples and mock tests exercise sums, records, recursive families, and combinations of string, natural-number, integer, and Boolean fields.

Most important results

Runtime-backed macros can invoke a Node.js chooser during elaboration and decode its JSON response into a value described by Generic PrimAtoms. Parallel source modes ask Agda to typecheck generated source before accepting it, while mock modes make the same boundary reproducible without launching the interface. Family reflection derives datatype descriptions, constructor names, encoders, decoders, and both directions of the round-trip property for a related set of declarations. The checked examples establish definitional equalities for decoded mocks across constructors, records, certified generics, and mixed primitive fields.

Source browser

Modules

Browse modulesOpen generated Agda sources

Cabinet index

Explore Formal Foundry

Search the archive

Find a page

Type to search the published content.