on master help sign in
Make a type less general
commiteb722a20dc1d7045e18065d415aad3127c5aea1e authorEvan Czaplicki <info@elm-lang.org> dateMon 22 Jul 2013, 14:41 (13 years ago) parentd9471f6
2 files changed+4−8
compiler/Compiler.hs+1−1 compiler/Initialize.hs+3−7
compiler/Compiler.hs+1−1
@@ -113,7 +113,7 @@ buildFile flags moduleNum numModules interfaces filePath =
113113 Left err -> mapM print err >> exitFailure
114114 Right modul -> do
115115 if print_program flags then print . pretty $ program modul else return ()
116− return (modul :: MetadataModule () ())
116+ return modul
117117
118118 if print_types flags then printTypes metaModule else return ()
119119 tipes <- toSrcTypes (types metaModule)
compiler/Initialize.hs+3−7
@@ -18,12 +18,9 @@ import qualified Type.Inference as TI
1818import qualified Type.Constrain.Declaration as TcDecl
1919
2020import System.IO.Unsafe
21+import SourceSyntax.PrettyPrint
2122
22−buildFromSource ::
23− (Data t, Data v) =>
24− Interfaces ->
25− String ->
26− Either [Doc] (MetadataModule t v)
23+buildFromSource :: Interfaces -> String -> Either [Doc] (MetadataModule () ())
2724buildFromSource interfaces source =
2825 do modul@(Module _ _ _ decls') <- Parse.program source
2926
@@ -41,8 +38,7 @@ buildFromSource interfaces source =
4138 -- reorder AST into strongly connected components
4239 program = SD.sortDefs . dummyLet $ TcDecl.toExpr decls,
4340 types = Map.empty,
44− datatypes = [ (name, vars, ctors) | Datatype name vars ctors <- decls ] ++
45− concatMap iAdts (Map.elems interfaces),
41+ datatypes = [ (name, vars, ctors) | Datatype name vars ctors <- decls ],
4642 fixities = [ (assoc,level,op) | Fixity assoc level op <- decls ],
4743 aliases = [ (name,tvs,tipe) | TypeAlias name tvs tipe <- decls ],
4844 foreignImports = [ (evt,v,name,typ) | ImportEvent evt v name typ <- decls ],