@@ -54,8 +54,7 @@ compile target f tm
54 dumpDefun <- getDumpDefun
54 dumpDefun <- getDumpDefun
55 case dumpCases of
55 case dumpCases of
56 Nothing -> return ()
56 Nothing -> return ()
57− Just f -> do cs <- getCaseTrees (concat used)
58− liftIO $ writeFile f (showCaseTrees cs)
57+ Just f -> liftIO $ writeFile f (showCaseTrees tagged)
59 case dumpDefun of
58 case dumpDefun of
60 Nothing -> return ()
59 Nothing -> return ()
61 Just f -> liftIO $ writeFile f (dumpDefuns defuns)
60 Just f -> liftIO $ writeFile f (dumpDefuns defuns)
@@ -99,18 +98,13 @@ mkDecls t used
99 decls <- mapM build ds
98 decls <- mapM build ds
100 return decls
99 return decls
102−getCaseTrees :: [Name] -> Idris [(Name, Def)]
105− let ds = filter (\ (n, d) -> n `elem` used || isCon d) $ ctxtAlist (tt_ctxt i)
108−showCaseTrees :: [(Name, Def)] -> String
101+showCaseTrees :: [(Name, LDecl)] -> String
109showCaseTrees ds = showSep "\n\n" (map showCT ds)
102showCaseTrees ds = showSep "\n\n" (map showCT ds)
111− showCT (n, CaseOp _ _ _ _ _ args sc)
104+ showCT (n, LFun f args lexp)
112− = show n ++ " " ++ showSep " " (map show args) ++ " = " ++ show sc
105+ = show n ++ " " ++ showSep " " (map show args) ++ " =\n\t "
113− showCT (n, _) = ""
106+ ++ show lexp
107+ showCT (n, LConstructor c t a) = "data " ++ show n ++ " " ++ show a
115isCon (TyDecl _ _) = True
109isCon (TyDecl _ _) = True
116isCon _ = False
110isCon _ = False