This will allow transforms to test if a Type is representable in VHDL.
-- Run a given TransformSession. Used mostly to setup the right calls and
-- an initial state.
runTransformSession :: UniqSupply.UniqSupply -> TransformSession a -> a
-runTransformSession uniqSupply session = State.evalState session initState
- where initState = TransformState uniqSupply Map.empty VarSet.emptyVarSet
+runTransformSession uniqSupply session = State.evalState session (emptyTransformState uniqSupply)
-- Local imports
import CoreShow
import Pretty
+import VHDLTypes -- For TypeState
data TransformState = TransformState {
tsUniqSupply_ :: UniqSupply.UniqSupply
, tsBindings_ :: Map.Map CoreBndr CoreExpr
, tsNormalized_ :: VarSet.VarSet -- ^ The binders that have been normalized
+ , tsType_ :: TypeState
}
+-- Create an (almost) empty TransformState, containing just a UniqSupply.
+emptyTransformState uniqSupply = TransformState uniqSupply Map.empty VarSet.emptyVarSet emptyTypeState
$( Data.Accessor.Template.deriveAccessors ''TransformState )