Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
69ee45d3
Commit
69ee45d3
authored
Aug 09, 2006
by
ei@vuokko.info
Browse files
Fix some Array.bounds calls to Array.getBounds
parent
5663a7b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/mdo/should_run/mdo001.hs
View file @
69ee45d3
...
...
@@ -6,17 +6,18 @@ import Control.Monad.Fix
import
Data.Array.IO
import
Monad
norm
a
=
mdo
s
<-
ioaA
1
s
0
norm
a
=
mdo
(
_
,
sz
)
<-
getBounds
a
s
<-
ioaA
1
s
sz
0
return
()
where
(
_
,
sz
)
=
bounds
a
ioaA
i
s
acc
where
ioaA
i
s
sz
acc
|
i
>
sz
=
return
acc
|
True
=
do
v
<-
readArray
a
i
writeArray
a
i
(
v
/
s
)
ioaA
(
i
+
1
)
s
$!
(
v
+
acc
)
ioaA
(
i
+
1
)
s
sz
$!
(
v
+
acc
)
toList
a
=
mapM
(
\
i
->
readArray
a
i
)
[
1
..
sz
]
where
(
_
,
sz
)
=
bounds
a
toList
a
=
do
(
_
,
sz
)
<-
getBounds
a
mapM
(
\
i
->
readArray
a
i
)
[
1
..
sz
]
test
::
Int
->
IO
()
test
sz
=
do
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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