Fix CodingStyle#Warnings URLs
[ghc-hetmet.git] / compiler / simplCore / SimplMonad.lhs
index 7126883..7e9598c 100644 (file)
@@ -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)