[Haskell-cafe] Type classes and type equality

Clifford Beshers clifford.beshers at linspire.com
Mon Apr 16 14:46:45 EDT 2007

Jeremy Shaw wrote:
> I noticed that the results can be a bit suprising sometimes. See if
> you can predict the answers to these (in ghci):

Interesting examples.  Here's another one that I would find problematic:

    *SameType> same Nothing (Just "xyzzy")
    *SameType> same (Nothing :: Maybe String) (Just "xyzzy")

And of course, the case with the integers lifts right up:

    *SameType> same (Just 1) (Just 1)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070416/be5f830f/attachment.htm

More information about the Haskell-Cafe mailing list