> It is, of course, trivial to implement this for lists. I've run into
> a snag, however, when trying to implement this for Arrays (as in
> Data.Array) - I can't seem to find a way to represent an empty array,
> which makes implementing 'empty' and 'null' impossible. Suggestions?
>
Empty arrays can be achieved by having bounds where the lower bound is
greater than the upper bound. An example would be:
> empty = array (1,0) []
The function null would check the bounds to see if the lower bound is
greater than the upper bound.
HTH,
/Josef
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe