function over Array and UArray possible?

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
29 Mar 2001 18:17:49 GMT


Thu, 29 Mar 2001 19:48:25 +0200, andreas.marth@daimlerchrysler.com <andreas.marth@daimlerchrysler.com> pisze:

> Is it possible to give a context, so that a function can have
> a signature which combines
> foo:: (Ix i) => Array i a -> Array i a                    and
> foo:: (Ix i) => UArray i a -> Uarray i a     ?

Yes:
    foo :: (IArray a e, Ix i) => a i e -> a i e

Use (!), (//), bounds, assocs, array etc. from module IArray (not Array).
They are overloaded over class IArray, which includes Array and UArray.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK