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

Safe HaskellNone



Definition for the thread transform.



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.



:: 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).