
25 Aug
2006
25 Aug
'06
7:33 p.m.
Hi
(2,5) whose type is "T a"
No, try expanding the type synonyms: mkT :: a -> T a mkT :: a -> Z -> (a, Z) mkT :: a -> Int -> (a, Int) The type of (2,5) is (a, Int), or in this specific case (Int, Int).
they return the same stuff with different types. Onle myT will return a type of type "T a". The type T is only a type alias, everywhere you can see T you can rewrite it. If mkT1 is applied to one argument, which is an Int, then you have a type T as a result.
For example, the type of "Test" is all of FilePath, [Char], String - all at the same time, since they are aliases for each other. Thanks Neil