[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-beginners
Subject: solved: implementation dependent (was Re: [Haskell-beginners] better
From: cppljevans () suddenlink ! net (Larry Evans)
Date: 2008-10-16 10:09:57
Message-ID: 48F74D04.2010302 () suddenlink ! net
[Download RAW message or body]
On 10/15/08 23:50, Larry Evans wrote:
> On 10/15/08 16:05, Larry Evans wrote:
>> I'd like to have an Array indices values
>> (see http://haskell.org/onlinereport/array.html)
>> defined on [minBound::indices ... maxBound::indices].
[snip]
> The aforementioned array.html has:
>
> _ -> error "Array.!: \
> \multiply defined array element")
>
> suggesting it should detect redefinitions;
> Is this a bug in my ghc library?
According to:
http://www.haskell.org/ghc/docs/6.6-latest/html/libraries/base/Data-Array.html
it's not. It's just implemented differently by libraries:
> The Haskell 98 Report further specifies that if any two associations
> in the list have the same index, the value at that index is undefined
> (i.e. bottom). However in GHC's implementation, the value at such an
> index is the value part of the last association with that index in the
> list.
So, if I want multiple definitions diagnosed as an error, I'll have to
do it myself :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20081016/69ff3cfa/attachment.htm
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic