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 attached does this; however, it also allows
duplicate definitions (e.g. in the attached, the
value for Term index is defined twice).

Is there a better way to do this?  Maybe a
way that doesn't use all the contexts?
Also, is there a way to do it so that the value
associated with an index is not redefined?
The aforementioned array.html has:

                            _     -> error "Array.!: \
                                           \multiply defined array element")

suggesting it should detect redefinitions; however,
the library on my system apparently doesn't do that.
It will detect missing defintions with the same error
found in array.html:

                            []    -> error "Array.!: \
                                           \undefined array element"

Is this a bug in my ghc library?  I'n on ubuntu and
synaptic shows the ghc6 version as:

  6.8.2-2ubuntu1