diff options
author | Geoffrey Mainland <mainland@cs.drexel.edu> | 2014-10-02 17:39:34 -0400 |
---|---|---|
committer | Geoffrey Mainland <mainland@cs.drexel.edu> | 2014-10-02 17:40:26 -0400 |
commit | daf3c2255a2aa7661937648e2f42fd1e8f64f8df (patch) | |
tree | d8824189c6dd1f48e2ba62b00a5ebf48dbe115e9 | |
parent | 146b56dd4f4dddcf5d0d13c347ca4b0d3f3e8d73 (diff) | |
download | haskell-wip/dph-fix.tar.gz |
Make Applicative-Monad fixes for tests.wip/dph-fix
-rw-r--r-- | testsuite/tests/array/should_run/arr016.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_run/cgrun068.hs | 2 |
3 files changed, 9 insertions, 5 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 +-} diff --git a/testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs b/testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs index 7243fadb06..05a84df210 100644 --- a/testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs +++ b/testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs @@ -361,7 +361,7 @@ cloneMArraySlow !marr !off n = -- Utilities for simplifying RNG passing newtype Rng s a = Rng { unRng :: StateT StdGen (ST s) a } - deriving Monad + deriving (Functor, Applicative, Monad) -- Same as 'randomR', but using the RNG state kept in the 'Rng' monad. rnd :: Random a => (a, a) -> Rng s a diff --git a/testsuite/tests/codeGen/should_run/cgrun068.hs b/testsuite/tests/codeGen/should_run/cgrun068.hs index 69a8b279f8..00d1249eaa 100644 --- a/testsuite/tests/codeGen/should_run/cgrun068.hs +++ b/testsuite/tests/codeGen/should_run/cgrun068.hs @@ -361,7 +361,7 @@ cloneMArraySlow !marr !off n = -- Utilities for simplifying RNG passing newtype Rng s a = Rng { unRng :: StateT StdGen (ST s) a } - deriving Monad + deriving (Functor, Applicative, Monad) -- Same as 'randomR', but using the RNG state kept in the 'Rng' monad. rnd :: Random a => (a, a) -> Rng s a |