git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix refEq in Prelude
commit05d332385a7186702e247ebb89ab6c1b2ba44ecd authorPhil Freeman <paf31@cantab.net> dateSun 16 Feb 2014, 11:26 (13 years ago) parent4be1807
1 file changed+14−14
prelude/prelude.purs+14−14
prelude/prelude.purs+14−14
@@ -54,11 +54,11 @@ module Prelude where
5454 instance Read Boolean where
5555 read "true" = true
5656 read _ = false
57−
57+
5858 foreign import readNumber "function readNumber(n) {\
5959 \ return parseInt(n, 10);\
6060 \}" :: String -> Number
61−
61+
6262 instance Read Number where
6363 read = readNumber
6464
@@ -164,13 +164,13 @@ module Prelude where
164164
165165 foreign import refEq "function refEq(r1) {\
166166 \ return function(r2) {\
167− \ return r1.value === r2.value;\
167+ \ return r1.values[0] === r2.values[0];\
168168 \ };\
169169 \}" :: forall a. Ref a -> Ref a -> Boolean
170170
171171 foreign import refIneq "function refIneq(r1) {\
172172 \ return function(r2) {\
173− \ return r1.value !== r2.value;\
173+ \ return r1.values[0] !== r2.values[0];\
174174 \ };\
175175 \}" :: forall a. Ref a -> Ref a -> Boolean
176176
@@ -369,7 +369,7 @@ module Monoid where
369369 instance Monoid String where
370370 mempty = ""
371371 (<>) = (++)
372−
372+
373373 instance Monoid [a] where
374374 mempty = []
375375 (<>) = Arrays.concat
@@ -440,11 +440,11 @@ module Maybe where
440440
441441 fromMaybe :: forall a. a -> Maybe a -> a
442442 fromMaybe a = maybe a (Prelude.id :: forall a. a -> a)
443−
443+
444444 instance Prelude.Monad Maybe where
445445 return = Just
446446 (>>=) m f = maybe Nothing f m
447−
447+
448448 instance Prelude.Applicative Maybe where
449449 pure = Just
450450 (<*>) (Just fn) x = fn <$> x
@@ -453,7 +453,7 @@ module Maybe where
453453 instance Prelude.Functor Maybe where
454454 (<$>) fn (Just x) = Just (fn x)
455455 (<$>) _ _ = Nothing
456−
456+
457457 instance (Show a) => Prelude.Show (Maybe a) where
458458 show (Just x) = "Just " ++ (show x)
459459 show Nothing = "Nothing"
@@ -467,11 +467,11 @@ module Either where
467467 either :: forall a b c. (a -> c) -> (b -> c) -> Either a b -> c
468468 either f _ (Left a) = f a
469469 either _ g (Right b) = g b
470−
470+
471471 instance Prelude.Monad (Either e) where
472472 return = Right
473473 (>>=) = either (\e _ -> Left e) (\a f -> f a)
474−
474+
475475 instance Prelude.Applicative (Either e) where
476476 pure = Right
477477 (<*>) (Left e) _ = Left e
@@ -480,7 +480,7 @@ module Either where
480480 instance Prelude.Functor (Either a) where
481481 (<$>) _ (Left x) = Left x
482482 (<$>) f (Right y) = Right (f y)
483−
483+
484484 instance (Show a, Show b) => Prelude.Show (Either a b) where
485485 show (Left x) = "Left " ++ (show x)
486486 show (Right y) = "Right " ++ (show y)
@@ -637,10 +637,10 @@ module Arrays where
637637 instance (Prelude.Show a) => Prelude.Show [a] where
638638 show [] = "[]"
639639 show (x:xs) = show x ++ " : " ++ show xs
640−
640+
641641 instance Prelude.Functor [] where
642642 (<$>) = map
643−
643+
644644 instance Prelude.Monad [] where
645645 return = singleton
646646 (>>=) = concatMap
@@ -898,7 +898,7 @@ module Math where
898898 foreign import tan "function tan(n){\
899899 \ return Math.tan(n);\
900900 \}" :: Number -> Number
901−
901+
902902 foreign import e "var e = Math.E;" :: Number
903903 foreign import ln2 "var ln2 = Math.LN2;" :: Number
904904 foreign import ln10 "var ln10 = Math.LN10;" :: Number