[Haskell-cafe] How to declare a Typeless Function

Fernan Bolando fernanbolando at mailc.net
Thu Jul 2 23:05:21 EDT 2009


I have a function that swaps rows of an array of double

swap :: Array (Int,Int) Double -> [Int] -> Array (Int,Int) Double

I then create a function that swaps rows of arrays of Complex Double

swap :: Array (Int, Int) (Complex Double) -> [Int] -> Array (Int, Int)
(Complex Double)

In reality the function swap does not care whether its working on a
double or a complex number.
how do I declare swap so that it will work whether it's a complex or a
double array.

I tried googling but I wasn't sure what to google.


More information about the Haskell-Cafe mailing list