
I don't think anyone has proposed weakening parametricity in this way.
You'd definitely still need
f :: (Typeable a, Typeable b) => a -> Maybe b
to make that function work.
The proposal is just to make the instances available for any concrete type
so you don't have to write them (and therefore can't screw them up or do
hinky things with them.)
-Edward
On Wed, Oct 3, 2012 at 9:12 AM, Ian Lynagh
On Wed, Oct 03, 2012 at 12:01:15PM +0000, Simon Peyton-Jones wrote:
* If we do make Typeable instances by default, there are two paths Plan A (easy): make GHC derive Typeable for everything, deprecate all uses of 'deriving Typeable'. Small downside: some
programs
that are currently rejected will be accepted.
Do you literally mean "derive Typeable for everything", or do you mean that Typeable would be available for all types, similar to how seq is?
i.e. would this be valid, or would it complain that it cannot infer (Typeable a, Typeable b)?:
f :: a -> Maybe b f = Data.Typeable.cast
Thanks Ian
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries