27 Mar
2002
27 Mar
'02
11:41 p.m.
José Romildo Malaquias wrote:
... My attempt was
mapIOArray :: Ix ix => (a -> b) -> IOArray ix a -> IO (IOArray ix b) mapIOArray f v = do w <- newIOArray bounds ???????????? mapping w (range bounds) where bounds = boundsIOArray v mapping w (i:is) = do x <- readIOArray v i writeIOArray w i (f x) mapping w is mapping w [] = return w
But I do not know what to use to replace the ????????????. Is there a polymorphic value in Haskell that can be of any type?
Yes, use "undefined" from the Prelude: undefined :: a undefined | False = undefined - Mark