Ticket #6082: Test.hs

File Test.hs, 375 bytes (added by milan, 21 months ago)

Module for array package to test the unsafeFreeze and unsafeThaw rule firings.

Line 
1{-# OPTIONS_GHC -ddump-rule-firings #-}
2
3module Test (test) where
4
5import Data.Array.ST
6import Data.Array.Unboxed
7
8test bounds = m
9  where m = runSTUArray $ do
10              a <- newArray bounds 0
11
12              a' <- unsafeFreeze a
13              a'' <- unsafeThaw a'
14              let _ = a' :: UArray Int Int
15                  _ = a'' `asTypeOf` a
16
17
18              return a