[Haskell-cafe] Re: GATD and pattern matching

Ben Millwood haskell at benmachine.co.uk
Fri Jun 11 07:51:36 EDT 2010


On Fri, Jun 11, 2010 at 12:46 AM, Felipe Lessa <felipe.lessa at gmail.com> wrote:
>
>  eqTypeable :: (Typeable a, Eq a, Typeable b, Eq b) => a -> b -> Bool
>  eqTypeable x y = case cast y of
>                     Just y' -> x == y'
>                     Nothing -> False
>

...or indeed:

eqTypeable x y = cast x == Just y


More information about the Haskell-Cafe mailing list