X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplMonad.lhs;h=7e9598cfcbb13c857fd728bcb8130e2c155410f4;hb=be7bf80fec1f471ceccbbe06885c265411baf25e;hp=7126883169a936fda610c366198c1ddfc8be6133;hpb=9670d6643e55adeb15f998a0efd5799d499ea2a4;p=ghc-hetmet.git diff --git a/compiler/simplCore/SimplMonad.lhs b/compiler/simplCore/SimplMonad.lhs index 7126883..7e9598c 100644 --- a/compiler/simplCore/SimplMonad.lhs +++ b/compiler/simplCore/SimplMonad.lhs @@ -4,6 +4,13 @@ \section[SimplMonad]{The simplifier Monad} \begin{code} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + module SimplMonad ( -- The monad SimplM, @@ -45,9 +52,8 @@ import FastTypes import GHC.Exts ( indexArray# ) -import GHC.Arr ( Array(..) ) - -import Array ( array, (//) ) +import Data.Array +import Data.Array.Base (unsafeAt) infixr 0 `thenSmpl`, `thenSmpl_` \end{code} @@ -469,11 +475,7 @@ isAmongSimpl on_switches -- Switches mentioned later occur *earlier* defined_elems = map mk_assoc_elem tidied_on_switches in -- (avoid some unboxing, bounds checking, and other horrible things:) - case sw_tbl of { Array _ _ stuff -> - \ switch -> - case (indexArray# stuff (tagOf_SimplSwitch switch)) of - (# v #) -> v - } + \ switch -> unsafeAt sw_tbl $ iBox (tagOf_SimplSwitch switch) where mk_assoc_elem k@(MaxSimplifierIterations lvl) = (iBox (tagOf_SimplSwitch k), SwInt lvl)