mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-29 15:49:00 +00:00
Generate outside of loop
This commit is contained in:
@@ -75,7 +75,7 @@ module TailRecCata =
|
||||
| Child
|
||||
| Parent
|
||||
|
||||
let private loop (cata : Cata<_, _>) (instructions : ResizeArray<_>) =
|
||||
let private loop (cata : Cata<_, _>) (instructions : ResizeArray<Instruction>) =
|
||||
let resultsStack = ResizeArray ()
|
||||
let builderResultsStack = ResizeArray ()
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ type Cata<'Expr, 'ExprBuilder> =
|
||||
ExprBuilder : ExprBuilderCata<'Expr, 'ExprBuilder>
|
||||
}
|
||||
|
||||
/// Catamorphism
|
||||
/// Methods to perform a catamorphism over the type Expr
|
||||
[<RequireQualifiedAccess>]
|
||||
module ExprCata =
|
||||
[<RequireQualifiedAccess>]
|
||||
@@ -51,6 +51,11 @@ module ExprCata =
|
||||
| ExprBuilderChild
|
||||
| ExprBuilderParent
|
||||
|
||||
let private loop (cata : Cata<_, _>) (instructions : ResizeArray<Instruction>) =
|
||||
let ExprBuilderStack = ResizeArray ()
|
||||
let ExprStack = ResizeArray ()
|
||||
ExprStack, ExprBuilderStack
|
||||
|
||||
/// Execute the catamorphism.
|
||||
let runExpr (cata : Cata<'ExprRet, 'ExprBuilderRet>) (x : Expr) : 'ExprRet =
|
||||
let instructions = ResizeArray ()
|
||||
|
||||
Reference in New Issue
Block a user