---------- Forwarded message ----------
From: Alexey Rodriguez <mrchebas(a)gmail.com>
Date: Nov 14, 2006 5:46 PM
Subject: Re: [Hs-Generics] Support for abstract data types
To: Pablo Nogueira <pirelo(a)googlemail.com>
On 11/10/06, Pablo Nogueira <pirelo(a)googlemail.com> wrote:
>
> Hi Alexey
>
> Could you please forward my replies to generics(a)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