function over Array and UArray possible?

Hallo! 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 ? at the moment I have a lot of functions foo and fooU which have the same body but different type signatures. Thanks for any comments, Andreas

Thu, 29 Mar 2001 19:48:25 +0200, andreas.marth@daimlerchrysler.com
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
participants (2)
-
andreas.marth@daimlerchrysler.com
-
qrczak@knm.org.pl