@@ -27,6 +27,7 @@ import Language.PureScript.Optimize as P
27import Language.PureScript.Operators as P
27import Language.PureScript.Operators as P
28import Language.PureScript.CaseDeclarations as P
28import Language.PureScript.CaseDeclarations as P
29import Language.PureScript.TypeDeclarations as P
29import Language.PureScript.TypeDeclarations as P
30+import Language.PureScript.BindingGroups as P
31import Data.List (intercalate)
32import Data.List (intercalate)
32import Data.Maybe (mapMaybe)
33import Data.Maybe (mapMaybe)
@@ -35,7 +36,7 @@ import Control.Monad ((>=>))
35compile :: [Declaration] -> Either String (String, String, Environment)
36compile :: [Declaration] -> Either String (String, String, Environment)
36compile decls = do
37compile decls = do
37 bracketted <- rebracket decls
38 bracketted <- rebracket decls
38− desugared <- desugarCases >=> desugarTypeDeclarations $ bracketted
39+ desugared <- desugarCases >=> desugarTypeDeclarations >=> (return . createBindingGroups) $ bracketted
39 (_, env) <- runCheck (typeCheckAll desugared)
40 (_, env) <- runCheck (typeCheckAll desugared)
40 let js = prettyPrintJS . map optimize . concat . mapMaybe (\decl -> declToJs Nothing global decl env) $ desugared
41 let js = prettyPrintJS . map optimize . concat . mapMaybe (\decl -> declToJs Nothing global decl env) $ desugared
41 let exts = intercalate "\n" . mapMaybe (externToPs 0 global env) $ desugared
42 let exts = intercalate "\n" . mapMaybe (externToPs 0 global env) $ desugared