From: simonm Date: Fri, 29 May 1998 12:29:02 +0000 (+0000) Subject: [project @ 1998-05-29 12:29:02 by simonm] X-Git-Tag: Approx_2487_patches~646 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9646846aba9c7102a77802b5cb38f26deb01e1eb;p=ghc-hetmet.git [project @ 1998-05-29 12:29:02 by simonm] Replace more GENERATE_SPECs with explicit SPECIALISE. --- diff --git a/ghc/lib/std/Array.lhs b/ghc/lib/std/Array.lhs index 390c481..9733f68 100644 --- a/ghc/lib/std/Array.lhs +++ b/ghc/lib/std/Array.lhs @@ -40,23 +40,23 @@ infixl 9 !, // {-# INLINE assocs #-} #endif -{-# GENERATE_SPECS listArray a{~,Int,IPr} b{} #-} +{-# SPECIALISE listArray :: (Int,Int) -> [b] -> Array Int b #-} listArray :: (Ix a) => (a,a) -> [b] -> Array a b listArray b vs = array b (zipWith (\ a b -> (a,b)) (range b) vs) -{-# GENERATE_SPECS indices a{~,Int,IPr} b{} #-} +{-# SPECIALISE indices :: Array Int b -> [Int] #-} indices :: (Ix a) => Array a b -> [a] indices = range . bounds -{-# GENERATE_SPECS elems a{~,Int,IPr} b{} #-} +{-# SPECIALISE elems :: Array Int b -> [b] #-} elems :: (Ix a) => Array a b -> [b] elems a = [a!i | i <- indices a] -{-# GENERATE_SPECS assocs a{~,Int,IPr} b{} #-} +{-# SPECIALISE assocs :: Array Int b -> [(Int,b)] #-} assocs :: (Ix a) => Array a b -> [(a,b)] assocs a = [(i, a!i) | i <- indices a] -{-# GENERATE_SPECS amap a{~,Int,IPr} b{} c{} #-} +{-# SPECIALISE amap :: (b -> c) -> Array Int b -> Array Int c #-} amap :: (Ix a) => (b -> c) -> Array a b -> Array a c amap f a = array b [(i, f (a!i)) | i <- range b] where b = bounds a