git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Expand type synonyms in type decls in let bindings
commit90bf9ab0fe3f82871d19385b5db0371a8731e11e authorPhil Freeman <paf31@cantab.net> dateWed 16 Apr 2014, 22:42 (13 years ago) parent7c2c38c
2 files changed+5−4
purescript.cabal+1−1 src/Language/PureScript/TypeChecker/Types.hs+4−3
purescript.cabal+1−1
@@ -1,5 +1,5 @@
11name: purescript
2−version: 0.4.19
2+version: 0.4.19.1
33cabal-version: >=1.8
44build-type: Custom
55license: MIT
src/Language/PureScript/TypeChecker/Types.hs+4−3
@@ -680,7 +680,7 @@ infer' (TypedValue checkType val ty) = do
680680 Just moduleName <- checkCurrentModule <$> get
681681 kind <- liftCheck $ kindOf moduleName ty
682682 guardWith (strMsg $ "Expected type of kind *, was " ++ prettyPrintKind kind) $ kind == Star
683− ty' <- introduceSkolemScope <=< replaceAllTypeSynonyms $ ty
683+ ty' <- introduceSkolemScope <=< replaceAllTypeSynonyms $ ty
684684 val' <- if checkType then check val ty' else return val
685685 return $ TypedValue True val' ty'
686686infer' (PositionedValue pos val) = rethrowWithPosition pos $ infer' val
@@ -693,8 +693,9 @@ inferLetBinding seen (ValueDeclaration ident nameKind [] Nothing tv@(TypedValue
693693 kind <- liftCheck $ kindOf moduleName ty
694694 guardWith (strMsg $ "Expected type of kind *, was " ++ prettyPrintKind kind) $ kind == Star
695695 let dict = if isFunction val then M.singleton (moduleName, ident) (ty, nameKind) else M.empty
696− TypedValue _ val' ty' <- if checkType then bindNames dict (check val ty) else return tv
697− bindNames (M.singleton (moduleName, ident) (ty', nameKind)) $ inferLetBinding (seen ++ [ValueDeclaration ident nameKind [] Nothing (TypedValue checkType val' ty')]) rest ret j
696+ ty' <- introduceSkolemScope <=< replaceAllTypeSynonyms $ ty
697+ TypedValue _ val' ty'' <- if checkType then bindNames dict (check val ty') else return tv
698+ bindNames (M.singleton (moduleName, ident) (ty'', nameKind)) $ inferLetBinding (seen ++ [ValueDeclaration ident nameKind [] Nothing (TypedValue checkType val' ty'')]) rest ret j
698699inferLetBinding seen (ValueDeclaration ident nameKind [] Nothing val : rest) ret j = do
699700 valTy <- fresh
700701 Just moduleName <- checkCurrentModule <$> get