mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-07 21:18:44 +00:00
Add catamorphism generator (#97)
This commit is contained in:
22
ConsumePlugin/Catamorphism.fs
Normal file
22
ConsumePlugin/Catamorphism.fs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace ConsumePlugin
|
||||
|
||||
open WoofWare.Myriad.Plugins
|
||||
|
||||
type Const =
|
||||
| Int of int
|
||||
| String of string
|
||||
|
||||
type PairOpKind =
|
||||
| NormalSeq
|
||||
| ThenDoSeq
|
||||
|
||||
[<CreateCatamorphism "TreeCata">]
|
||||
type Tree =
|
||||
| Const of Const
|
||||
| Pair of Tree * Tree * PairOpKind
|
||||
| Sequential of Tree list
|
||||
| Builder of Tree * TreeBuilder
|
||||
|
||||
and TreeBuilder =
|
||||
| Child of TreeBuilder
|
||||
| Parent of Tree
|
Reference in New Issue
Block a user