On 10/9/07, David Benbennick <[EMAIL PROTECTED]> wrote:
> On 10/9/07, Johan Tibell <[EMAIL PROTECTED]> wrote:
> > data Rope = Empty
> >           | Leaf
> >           | Node !Rope !Rope
>
> > The point is that Empty
> > can only appear at the top by construction
>
> How about indicating this in your data type?  I.e.,
>
> data Rope = Empty | NonEmptyRope
> data NonEmptyRope = Leaf | Node !NonEmptyRope !NonEmptyRope
>

That would be an idea. What are the performance effects of this? I'm
trying to not have too many layers of indirection (I will spend quite
some time reading -ddumpsimpl to optimize this library so anything
that makes that simpler is a Good Thing.)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to