
19 Aug
2011
19 Aug
'11
8:59 a.m.
Anupam Jain
However, if I try to parameterise over the function 'f' it does not work! -
p f = (m1',m2') where m1 = M ("1", ()) m2 = M ("2", True) m1' = f m1 m2' = f m2
It doesn't even typecheck, producing the error - "Couldn't match expected type 'Bool' with actual type '()'"
Is there a particular reason for this? How can I define a function like 'p' within Haskell?
Try to write the type signature for 'p'. And as a general advice: Always write type signatures. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/