Definition for the thread transform.
Thread config defines what state token to use, and what functions need to have it threaded though them.
Wrap the result type of a stateful computation with the state type.
|:: Exp (AnTEC () Name) Name|
|-> Exp (AnTEC () Name) Name|
|-> Exp () Name|
Wrap the result of a stateful computation with the state token.
Make a pattern to unwrap the result of a stateful computation.
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).