solved: implementation dependent (was Re: [Haskell-beginners] better
way to create Array defined on all indices
cppljevans at suddenlink.net
Thu Oct 16 10:17:40 EDT 2008
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].
> The aforementioned array.html has:
> _ -> error "Array.!: \
> \multiply defined array element")
> suggesting it should detect redefinitions;
> Is this a bug in my ghc library?
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
So, if I want multiple definitions diagnosed as an error, I'll have to
do it myself :(
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners