Testsuite: pass '-s --no-print-directory' to MAKE
[ghc.git] / testsuite / tests / module / T1148.hs
1 {-# OPTIONS_GHC -XFlexibleContexts -fwarn-unused-imports #-}
2
3 module ArrayBoundedU
4 ( T
5 , create
6 , at
7 ) where
8
9 import Data.Ix
10 import qualified Data.Array.Unboxed as Array
11 import Data.Array.Base (unsafeAt)
12
13 newtype T i e = T (Array.UArray i e)
14
15 create :: (Ix i, Bounded i, Array.IArray Array.UArray e) => [(i,e)] -> T i e
16 create ies = T (Array.array (minBound, maxBound) ies)
17
18 at :: (Ix i, Bounded i, Array.IArray Array.UArray e) => T i e -> i -> e
19 at (T a) i = unsafeAt a (index (minBound, maxBound) i)