Changes to Typeable
ekmett at gmail.com
Wed Oct 3 15:20:00 CEST 2012
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.)
On Wed, Oct 3, 2012 at 9:12 AM, Ian Lynagh <igloo at earth.li> wrote:
> 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
> > 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
> Libraries mailing list
> Libraries at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries