Fwd: [Hs-Generics] Support for abstract data types

Alexey Rodriguez mrchebas at gmail.com
Tue Nov 14 12:46:46 EST 2006


---------- Forwarded message ----------
From: Alexey Rodriguez <mrchebas at gmail.com>
Date: Nov 14, 2006 5:46 PM
Subject: Re: [Hs-Generics] Support for abstract data types
To: Pablo Nogueira <pirelo at googlemail.com>



On 11/10/06, Pablo Nogueira <pirelo at googlemail.com> wrote:
>
> Hi Alexey
>
> Could you please forward my replies to generics at haskell.org? I still
> can't post and stil haven't got a reply from the administrator :-(
>
> One minor addition:
>
> > toQueue (Inl (e :*: q)) = e `prependToQueue` q
> > toQueue (Inr ()) = emptyQueue
>
> What is `prependToQueue'? It is not a queue operation given by a queue
> interface. I take it is actually  "enqueue . reverse". If this is the
> case, what you propose looks impractical.


I assumed it to be an operation internal to the queue library, remember that
the mapping is written by the Queue library writer, not the user.
"prependToQueue" does not need to be exposed to the user. What is exposed is
the structural representation type and the embedding projection, which the
user exploits by using Queue-specialized generic functions.

Cheers,

Alexey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/generics/attachments/20061114/18f8e196/attachment.htm


More information about the Generics mailing list