git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #821 from purescript/820

Fix #820

commit1e8ef265ba6fd53400614622ec43aeee4f00b47c authorPhil Freeman <paf31@cantab.net> dateMon 19 Jan 2015, 12:34 (12 years ago) parentf2459bae720b6a
2 files changed+7−1
examples/passing/CheckFunction.purs+5 src/Language/PureScript/TypeChecker/Types.hs+2−1
examples/passing/CheckFunction.pursnew file+5
@@ -0,0 +1,5 @@
1+module Main where
2+
3+test = ((\x -> x+1) >>> (\x -> x*2)) 4
4+
5+main = Debug.Trace.trace "Done"
src/Language/PureScript/TypeChecker/Types.hs+2−1
@@ -472,7 +472,8 @@ check' (ArrayLiteral vals) t@(TypeApp a ty) = do
472472 a =?= tyArray
473473 array <- ArrayLiteral <$> forM vals (`check` ty)
474474 return $ TypedValue True array t
475−check' (Abs (Left arg) ret) ty@(TypeApp (TypeApp t argTy) retTy) | t == tyFunction = do
475+check' (Abs (Left arg) ret) ty@(TypeApp (TypeApp t argTy) retTy) = do
476+ t =?= tyFunction
476477 Just moduleName <- checkCurrentModule <$> get
477478 ret' <- makeBindingGroupVisible $ bindLocalVariables moduleName [(arg, argTy, Defined)] $ check ret retTy
478479 return $ TypedValue True (Abs (Left arg) ret') ty