Re:C for Python programmers (2011)
by evincarofautumn on Monday November 07, 2016 @10:15PM
(#12897311)
Yeah, as long as we’re mixing notations, it’s really:
*i :: Integer
From which you can conclude i :: Ptr Integer.And the dereference operator does have the type you specified, but not in an lvalue—there the operator is really a mixfix one:
(*_ = _) :: Ptr a -> a -> a
This isn’t specified directly by the standard, but follows from the rules about how an assignment operator must examine the structure of its first operand.
I definitely think of (int * i) as (i :: Ptr Integer) and (* i) in an expression like 42 + * i as (* :: Ptr Integer -> Integer).