instance inference
Simon Peyton-Jones
simonpj at microsoft.com
Mon Dec 12 10:38:18 EST 2005
Interesting example. Yes, GHC builds recursive dictionaries these days.
There's a bit of discussion in our SYB paper in ICFP'05.
http://research.microsoft.com/%7Esimonpj/papers/hmap/ And Martin
Sulzmann has a whole paper about this point.
http://www.comp.nus.edu.sg/~sulzmann/ ("Co-induction...")
Simon
| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
[mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of Ross Paterson
| Sent: 12 December 2005 10:46
| To: glasgow-haskell-users at haskell.org
| Subject: instance inference
|
| I'm puzzled that the following is accepted. Is some sort of greatest
| fixed point computation used for instances?
|
| {-# OPTIONS_GHC -fglasgow-exts #-}
| module M where
|
| class C a b where c :: a -> b -> Bool
|
| instance C b b => C (Maybe a) b where c x y = c y y
|
| f :: Maybe a -> Bool
| f x = c x x
|
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
More information about the Glasgow-haskell-users
mailing list