purescript 0.4.20 → 0.5.0
raw patch · 3 files changed
+5/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- purescript.cabal +1/−1
- src/Language/PureScript/CodeGen/JS.hs +3/−1
- src/Language/PureScript/TypeChecker/Types.hs +1/−0
purescript.cabal view
@@ -1,5 +1,5 @@ name: purescript-version: 0.4.20+version: 0.5.0 cabal-version: >=1.8 build-type: Custom license: MIT
src/Language/PureScript/CodeGen/JS.hs view
@@ -56,13 +56,15 @@ moduleToJs :: ModuleType -> Options -> Module -> Environment -> [JS] moduleToJs mt opts (Module name decls (Just exps)) env = case mt of CommonJS -> moduleBody ++ [JSAssignment (JSAccessor "exports" (JSVar "module")) moduleExports]- Globals ->+ Globals | not isModuleEmpty -> [ JSVariableIntroduction (fromJust (optionsBrowserNamespace opts)) (Just (JSBinary Or (JSVar (fromJust (optionsBrowserNamespace opts))) (JSObjectLiteral [])) ) , JSAssignment (JSAccessor (moduleNameToJs name) (JSVar (fromJust (optionsBrowserNamespace opts)))) (JSApp (JSFunction Nothing [] (JSBlock (moduleBody ++ [JSReturn moduleExports]))) []) ]+ _ -> [] where+ isModuleEmpty = null jsDecls moduleBody = JSStringLiteral "use strict" : jsImports ++ jsDecls moduleExports = JSObjectLiteral $ concatMap exportToJs exps jsDecls = (concat $ mapMaybe (\decl -> fmap (map $ optimize opts) $ declToJs opts name decl env) decls)
src/Language/PureScript/TypeChecker/Types.hs view
@@ -421,6 +421,7 @@ -- Check that two types unify -- unifiesWith :: Environment -> Type -> Type -> Bool+unifiesWith _ (TUnknown u1) (TUnknown u2) | u1 == u2 = True unifiesWith _ (Skolem _ s1 _) (Skolem _ s2 _) | s1 == s2 = True unifiesWith _ (TypeVar v1) (TypeVar v2) | v1 == v2 = True unifiesWith _ (TypeConstructor c1) (TypeConstructor c2) | c1 == c2 = True