From: simonpj Date: Thu, 12 Feb 2004 14:54:19 +0000 (+0000) Subject: [project @ 2004-02-12 14:54:19 by simonpj] X-Git-Tag: nhc98-1-18-release~390 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=2ceb6e9c72b7af137f54adfe6a4d2e0085193f80;p=ghc-base.git [project @ 2004-02-12 14:54:19 by simonpj] Document non-std behaviour of array --- diff --git a/GHC/Arr.lhs b/GHC/Arr.lhs index 5c4c9d6..c0c7009 100644 --- a/GHC/Arr.lhs +++ b/GHC/Arr.lhs @@ -310,6 +310,10 @@ instance Eq (STArray s i e) where arrEleBottom :: a arrEleBottom = error "(Array.!): undefined array element" +-- | Note: GHC's implementation of @array@ differs slightly from the Haskell 98 +-- report. If the same index appears twice, GHC's implementation takes the +-- value from last (index,value) pair in the list, rather than yielding bottom +-- for that array slot. {-# INLINE array #-} array :: Ix i => (i,i) -> [(i, e)] -> Array i e array (l,u) ies = unsafeArray (l,u) [(index (l,u) i, e) | (i, e) <- ies]