git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Additional test
commitab7b8abef2cc54efc17055275ddf374d64843d62 authorPhil Freeman <paf31@cantab.net> dateWed 16 Jul 2014, 17:17 (12 years ago) parent363b03c
2 files changed+11−4
examples/passing/MultiArgFunctions.purs+8−1 src/Language/PureScript/TypeChecker/Types.hs+3−3
examples/passing/MultiArgFunctions.purs+8−1
@@ -4,6 +4,12 @@ import Data.Function
44import Control.Monad.Eff
55import Debug.Trace
66
7+f = mkFn2 $ \a b -> runFn2 g a b + runFn2 g b a
8+
9+g = mkFn2 $ \a b -> case {} of
10+ _ | a <= 0 || b <= 0 -> b
11+ _ -> runFn2 f (a - 1) (b - 1)
12+
713main = do
814 runFn0 (mkFn0 $ \_ -> trace $ show 0)
915 runFn1 (mkFn1 $ \a -> trace $ show a) 1
@@ -11,4 +17,5 @@ main = do
1117 runFn3 (mkFn3 $ \a b c -> trace $ show [a, b, c]) 1 2 3
1218 runFn4 (mkFn4 $ \a b c d -> trace $ show [a, b, c, d]) 1 2 3 4
1319 runFn5 (mkFn5 $ \a b c d e -> trace $ show [a, b, c, d, e]) 1 2 3 4 5
14− trace "Done!"
20+ print $ runFn2 g 15 12
21+ trace "Done!"
src/Language/PureScript/TypeChecker/Types.hs+3−3
@@ -227,9 +227,9 @@ typeForBindingGroupElement moduleName el dict untypedDict =
227227 guardWith (strMsg $ "Expected type of kind *, was " ++ prettyPrintKind kind) $ kind == Star
228228 -- Check the type with the new names in scope
229229 ty' <- introduceSkolemScope <=< replaceAllTypeSynonyms $ ty
230− val'' <- bindNames dict $ if checkType
231− then TypedValue True <$> check val' ty' <*> pure ty'
232− else return (TypedValue False val' ty')
230+ val'' <- if checkType
231+ then bindNames dict $ TypedValue True <$> check val' ty' <*> pure ty'
232+ else return (TypedValue False val' ty')
233233 return (ident, (val'', ty'))
234234 -- Untyped declarations
235235 (ident, (val', Nothing)) -> do