From 2ceb6e9c72b7af137f54adfe6a4d2e0085193f80 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 12 Feb 2004 14:54:19 +0000 Subject: [PATCH] [project @ 2004-02-12 14:54:19 by simonpj] Document non-std behaviour of array --- GHC/Arr.lhs | 4 ++++ 1 file changed, 4 insertions(+) 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] -- 1.7.10.4