Type inference shows (Num (a -> a), Num a)
Defining f and g as:
f x = x + 1 g x y = x + y
Entering :t f . g gives: f . g :: (Num (a -> a), Num a) => a -> a -> a
Formally, it is correct, since Num (a -> a) is never going to be a number. Though me and my tutor thought it might be a bug, and f . g shouldn't be recognised as a well-formed expression.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | lo@cs.ox.ac.uk |
Operating system | |
Architecture |