diff --git a/compiler/Compiler.hs b/compiler/Compiler.hs index f027b82..f05c1e3 100644 --- a/compiler/Compiler.hs +++ b/compiler/Compiler.hs @@ -113,7 +113,7 @@ buildFile flags moduleNum numModules interfaces filePath = Left err -> mapM print err >> exitFailure Right modul -> do if print_program flags then print . pretty $ program modul else return () - return (modul :: MetadataModule () ()) + return modul if print_types flags then printTypes metaModule else return () tipes <- toSrcTypes (types metaModule) diff --git a/compiler/Initialize.hs b/compiler/Initialize.hs index b60a310..de45afa 100644 --- a/compiler/Initialize.hs +++ b/compiler/Initialize.hs @@ -18,12 +18,9 @@ import qualified Type.Inference as TI import qualified Type.Constrain.Declaration as TcDecl import System.IO.Unsafe +import SourceSyntax.PrettyPrint -buildFromSource :: - (Data t, Data v) => - Interfaces -> - String -> - Either [Doc] (MetadataModule t v) +buildFromSource :: Interfaces -> String -> Either [Doc] (MetadataModule () ()) buildFromSource interfaces source = do modul@(Module _ _ _ decls') <- Parse.program source @@ -41,8 +38,7 @@ buildFromSource interfaces source = -- reorder AST into strongly connected components program = SD.sortDefs . dummyLet $ TcDecl.toExpr decls, types = Map.empty, - datatypes = [ (name, vars, ctors) | Datatype name vars ctors <- decls ] ++ - concatMap iAdts (Map.elems interfaces), + datatypes = [ (name, vars, ctors) | Datatype name vars ctors <- decls ], fixities = [ (assoc,level,op) | Fixity assoc level op <- decls ], aliases = [ (name,tvs,tipe) | TypeAlias name tvs tipe <- decls ], foreignImports = [ (evt,v,name,typ) | ImportEvent evt v name typ <- decls ],