[Haskell-cafe] Re: Eta-expansion and existentials (or: types
destroy my laziness)
Max Bolingbroke
batterseapower at hotmail.com
Fri Oct 22 07:20:04 EDT 2010
On 22 October 2010 12:03, Dan Doel <dan.doel at gmail.com> wrote:
> data Mu f = In { out :: f (Mu f) }
>
> instance Show (f (Mu f)) => Show (Mu f) where
> show = show . out
>
> Is that an example of a value recursive dictionary?
Assuming the Show (f (Mu f)) instance uses the (Mu f) one, AFAIK this
should indeed build a loopy dictionary.
I think this extension was motivated by "Scrap your Boilerplate with
Class" - see section 5 of
http://research.microsoft.com/en-us/um/people/simonpj/papers/hmap/gmap3.pdf.
Cheers,
Max
More information about the Haskell-Cafe
mailing list