ddc-core-flow-0.4.1.1: Disciplined Disciple Compiler data flow compiler.

Safe HaskellNone

DDC.Core.Flow.Transform.Wind

Description

Convert a loop expressed with the loopn combinators into a tail recursive loop with accumulators.

ASUMPTIONS:

  • No nested loops. We could support these, but we don't yet.
  • Outer control flow is only defined via the loopn combinators.
  • References don't escape, so they're not stored in data structures or captured in closures.
  • No aliasing of references, so updating ref with a particular name does not affect any other ref.
  • Refs holding loop counters for loopn are not written to by any other statements.

The above assumptions are true for code generated with the lowering transform, but won't be true for general code, and we don't check for violiations of these assumptions.

Synopsis

Documentation

data RefInfo Source

Current information for a reference.

windModule :: Module () Name -> Module () NameSource

Apply the wind transform to a single module.