newbie question regarding type declarations

gangadhar npk phani at myrealbox.com
Fri Oct 31 17:30:06 EST 2003


hi,
  I am a newbie to Haskell. I am reading the tutorial by Hal Daume III. Regarding the function types which are an extension of lambda calculus, I was wondering if at all it is possible to write a type that would return two values as the output - something like a square function which would take a pair and return a  pair.
 I tried this, but there are errors

square :: (Num a, Num b) => (a ,b)
square (x , y) = (x*x , y*y)
How can I specify that the square functions output would be a pair ?

thank you
gangadhar





More information about the Haskell-Cafe mailing list