
10 Apr
2016
10 Apr
'16
12:16 p.m.
Hi, I’m looking at mc :: (Integral a) => a -> a mc x | x > 100 = x - 10 | otherwise = mc ( mc ( x + 11 ) ) the mc ( mc ( x + 11 ) ) can also be written as mc . mc $ x + 11 and I expected it could also be written as mc . mc ( x + 11 ) but the compiler error starts off with Couldn't match expected type ‘a’ with actual type ‘a0 -> c0’ so that is telling me, isn’t it (?) , that using parens is making the argument to the second mc into a function ‘a0 -> c0’ So is mc . mc $ x + 11 the only correct way to write this particular function in ‘.’ style ? Many Thanks Mike