Add catamorphism generator (#97)

This commit is contained in:
Patrick Stevens
2024-02-17 23:16:54 +00:00
committed by GitHub
parent f55a810608
commit 3ea1c7ab79
21 changed files with 2259 additions and 16 deletions

View File

@@ -62,3 +62,11 @@ type JsonParseAttribute (isExtensionMethod : bool) =
/// i.e. to stamp out HTTP REST clients from interfaces defining the API.
type HttpClientAttribute () =
inherit Attribute ()
/// Attribute indicating a DU type to which the "create catamorphism" Myriad
/// generator should apply during build.
/// Supply the `typeName` for the name of the record type we will generate, which contains
/// all the catas required; for example, "MyThing" would generate:
/// type MyThing<'a, 'b> = { Du1 : Du1Cata<'a, 'b> ; Du2 : Du2Cata<'a, 'b> }.
type CreateCatamorphismAttribute (typeName : string) =
inherit Attribute ()