Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
27f75527
Commit
27f75527
authored
Oct 02, 2014
by
Geoffrey Mainland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Applicative-Monad fixes for tests.
parent
710bc8d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
testsuite/tests/array/should_run/arr016.hs
testsuite/tests/array/should_run/arr016.hs
+7
-3
testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs
...uite/tests/codeGen/should_run/CopySmallArrayStressTest.hs
+1
-1
testsuite/tests/codeGen/should_run/cgrun068.hs
testsuite/tests/codeGen/should_run/cgrun068.hs
+1
-1
No files found.
testsuite/tests/array/should_run/arr016.hs
View file @
27f75527
{-# 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
-}
testsuite/tests/codeGen/should_run/CopySmallArrayStressTest.hs
View file @
27f75527
...
...
@@ -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
...
...
testsuite/tests/codeGen/should_run/cgrun068.hs
View file @
27f75527
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment