newbie question regarding type declarations

31 Oct
2003
31 Oct
'03
6:39 a.m.
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
7988
Age (days ago)
7988
Last active (days ago)
0 comments
1 participants
participants (1)
-
gangadhar npk