[Haskell-cafe] Re: Optimization problem

Ross Paterson ross at soi.city.ac.uk
Thu Sep 28 09:44:32 EDT 2006


On Tue, Sep 19, 2006 at 01:52:02PM +0100, Conor McBride wrote:
> apfelmus at quantentunnel.de wrote:
> >Btw, why are there no irrefutable patterns for GADTs?
> 
> Just imagine
> 
> > data Eq a b where Refl :: Eq a a
> 
> > coerce :: Eq a b -> a -> b
> > coerce ~Refl a = a
> 
> coerce undefined True :: String
> 
> Bang you're dead. Or rather... Twiddle you're dead.

Does anything go wrong with irrefutable patterns for existential types?



More information about the Haskell-Cafe mailing list