git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
More failing tests
commitb3d3f79ddb779a80527397767113bdea685088d5 authorGary Burgess <gary.burgess@gmail.com> dateSun 8 Feb 2015, 01:13 (12 years ago) parentc3e728c
2 files changed+22−13
examples/passing/ObjectUpdater.purs+20−11 examples/passing/ObjectWildcards.purs+2−2
examples/passing/ObjectUpdater.purs+20−11
@@ -3,21 +3,30 @@ module Main where
33import Control.Monad.Eff
44import Debug.Trace
55
6−foreign import data Error :: !
7−
8−foreign import error
6+foreign import eqeqeq
97 """
10− function error() {
11− throw new Error("Object update failed");
12− }
13− """ :: forall e. Eff (error :: Error | e) Unit
8+ function eqeqeq(x) {
9+ return function (y) {
10+ if (x == y) return x;
11+ throw new Error("Unexpected result: " + x + " /== " + y);
12+ };
13+ };
14+ """ :: forall a. a -> a -> a
15+
16+(===) = eqeqeq
17+infixl 4 ===
1418
1519getValue :: forall e. Eff (| e) Boolean
1620getValue = return true
1721
1822main = do
1923 let record = { value: false }
20− record2 <- record { value = _ } <$> getValue
21− if record2.value
22− then trace "Done"
23− else error
24+ record' <- record { value = _ } <$> getValue
25+ print $ record'.value === true
26+
27+ let point = { x: 1, y: 1 }
28+ x = 10
29+ point' = (point { x = _, y = x }) 100
30+
31+ print $ point'.x === 100
32+ print $ point'.y === 10
examples/passing/ObjectWildcards.purs+2−2
@@ -26,6 +26,6 @@ main = do
2626 print obj.value
2727 let x = 1
2828 point <- { x: _, y: x } <$> return 2
29− print $ point.x === 1
30− print $ point.y === 2
29+ print $ point.x === 2
30+ print $ point.y === 1
3131 trace (mkRecord 1 "Done!").bar