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

Safe HaskellNone

DDC.Core.Flow.Transform.Thread

Description

Definition for the thread transform.

Synopsis

Documentation

threadConfig :: Config () NameSource

Thread config defines what state token to use, and what functions need to have it threaded though them.

wrapResultType :: Type Name -> Type NameSource

Wrap the result type of a stateful computation with the state type.

wrapResultExpSource

Arguments

:: Exp (AnTEC () Name) Name

World expression

-> Exp (AnTEC () Name) Name

Result expression

-> Exp () Name 

Wrap the result of a stateful computation with the state token.

unwrapResult :: Name -> Maybe (Bind Name -> [Bind Name] -> Pat Name)Source

Make a pattern to unwrap the result of a stateful computation.

threadType :: Name -> Type Name -> Maybe (Type Name)Source

Get the new type for a stateful primop. The new types have a World# token threaded though them, which make them suitable for applying the Thread transform when converting a Core Flow program to a language that needs such state threading (like GHC Core).