summaryrefslogtreecommitdiff
path: root/src/Compile.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compile.hs')
-rw-r--r--src/Compile.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Compile.hs b/src/Compile.hs
index e3eb207..e2d004a 100644
--- a/src/Compile.hs
+++ b/src/Compile.hs
@@ -282,11 +282,11 @@ genStructs ty = do
tell (BList (genStruct name ty))
-genAllStructs :: Foldable t => t Ty -> [StructDecl]
-genAllStructs tys = toList $ evalState (execWriterT (mapM_ (\t -> case reSTy t of Some t' -> genStructs t') tys)) mempty
+genAllStructs :: Foldable t => t (Some STy) -> [StructDecl]
+genAllStructs tys = toList $ evalState (execWriterT (mapM_ (\(Some t) -> genStructs t) tys)) mempty
data CompState = CompState
- { csStructs :: Set Ty
+ { csStructs :: Set (Some STy)
, csTopLevelDecls :: Bag String
, csStmts :: Bag Stmt
, csNextId :: Int }
@@ -329,7 +329,7 @@ scope m = do
emitStruct :: STy t -> CompM String
emitStruct ty = CompM $ do
- modify $ \s -> s { csStructs = Set.insert (unSTy ty) (csStructs s) }
+ modify $ \s -> s { csStructs = Set.insert (Some ty) (csStructs s) }
return (genStructName ty)
emitTLD :: String -> CompM ()
@@ -348,7 +348,7 @@ compileToString :: Int -> SList STy env -> Ex env t -> (String, KernelOffsets)
compileToString codeID env expr =
let args = nameEnv env
(res, s) = runCompM (compile' args expr)
- structs = genAllStructs (csStructs s <> Set.fromList (unSList unSTy env))
+ structs = genAllStructs (csStructs s <> Set.fromList (unSList Some env))
(arg_pairs, arg_metrics) =
unzip $ reverse (unSList (\(Product.Pair t (Const n)) -> ((n, repSTy t), metricsSTy t))