
24 Sep
2010
24 Sep
'10
9:35 a.m.
Hello, this is maybe a simple question: cbinary :: a -> b -> (a -> b -> b) -> (b -> c) -> c -- Version 1 works: cbinary x y f g = g (f x y) -- Version 2 should be exactly the same according -- to my understanding of the "." operator definition, -- but fails with: -- Occurs check: cannot construct the infinite type: b = b -> b -- When generalising the type(s) for `cbinary' -- cbinary x y f g = (g . f) x y Can anybody explain why this happens and how I can compose f and g? Hint: It works fine if f is defined as an unary function. Thank you very much! Axel