summaryrefslogtreecommitdiff
path: root/testsuite/tests/array
diff options
context:
space:
mode:
authorGeoffrey Mainland <mainland@cs.drexel.edu>2014-10-02 17:39:34 -0400
committerGeoffrey Mainland <mainland@cs.drexel.edu>2014-10-21 14:44:17 -0400
commit27f7552745fa320e72096b30b08558b7a275bbcc (patch)
tree9b0312d6d9d98e67bcefe902c8424db0611c1abe /testsuite/tests/array
parent710bc8d77be454243ae8de2a1fb9070b72b525c4 (diff)
downloadhaskell-27f7552745fa320e72096b30b08558b7a275bbcc.tar.gz
Make Applicative-Monad fixes for tests.
Diffstat (limited to 'testsuite/tests/array')
-rw-r--r--testsuite/tests/array/should_run/arr016.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/testsuite/tests/array/should_run/arr016.hs b/testsuite/tests/array/should_run/arr016.hs
index 055e6602be..0e8e2bfe2e 100644
--- a/testsuite/tests/array/should_run/arr016.hs
+++ b/testsuite/tests/array/should_run/arr016.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE ScopedTypeVariables, DatatypeContexts #-}
+{-# LANGUAGE ScopedTypeVariables #-}
module Main where
@@ -151,7 +151,7 @@ instance Show (a -> b) where { show _ = "<FN>" }
------------------------------------------------------------------------------
-data (Ix a) => Array a b = MkArray (a,a) (a -> b) deriving ()
+data Array a b = MkArray (a,a) (a -> b) deriving ()
array :: (Ix a) => (a,a) -> [(a,b)] -> Array a b
array b ivs =
@@ -259,6 +259,10 @@ generate n rnd (Gen m) = m size rnd'
instance Functor Gen where
fmap f m = m >>= return . f
+instance Applicative Gen where
+ pure = return
+ (<*>) = liftM2 id
+
instance Monad Gen where
return a = Gen (\n r -> a)
Gen m >>= k =
@@ -508,4 +512,4 @@ instance Observable StdGen where { observer = observeBase }
instance Observable a => Observable (Gen a) where
observer (Gen a) = send "Gen" (return (Gen) << a)
--} \ No newline at end of file
+-}