X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FArr.lhs;h=5c4c9d662cc11502ac1ce22d7c1e8608595a8e6a;hb=eb1c9bc6dedfdb161bfeff214917f1beb23c95f7;hp=b2784fb382b49aa0185ebb8b6f5c160f808c9f4b;hpb=69c06d8a8b8a90492b81b1f252094949e0ace294;p=haskell-directory.git diff --git a/GHC/Arr.lhs b/GHC/Arr.lhs index b2784fb..5c4c9d6 100644 --- a/GHC/Arr.lhs +++ b/GHC/Arr.lhs @@ -284,7 +284,7 @@ data Ix i => Array i e = Array !i !i (Array# e) -- -- * @s@: the state variable argument for the 'ST' type -- --- * @i@: the index type of the array (should be an instance of @Ix@) +-- * @i@: the index type of the array (should be an instance of 'Ix') -- -- * @e@: the element type of the array. -- @@ -476,19 +476,14 @@ instance (Ix i, Ord e) => Ord (Array i e) where instance (Ix a, Show a, Show b) => Show (Array a b) where showsPrec p a = - showParen (p > 9) $ + showParen (p > appPrec) $ showString "array " . - shows (bounds a) . + showsPrec appPrec1 (bounds a) . showChar ' ' . - shows (assocs a) - -{- -instance (Ix a, Read a, Read b) => Read (Array a b) where - readsPrec p = readParen (p > 9) - (\r -> [(array b as, u) | ("array",s) <- lex r, - (b,t) <- reads s, - (as,u) <- reads t ]) --} + showsPrec appPrec1 (assocs a) + -- Precedence of 'array' is the precedence of application + +-- The Read instance is in GHC.Read \end{code}