git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #820
commite720b6a3e3c102e7657211b18187a3a9e8fe56a7 authorPhil Freeman <paf31@cantab.net> dateMon 19 Jan 2015, 09:18 (12 years ago) parentf2459ba
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