On Sat, May 3, 2008 at 12:30 PM, Edsko de Vries <[EMAIL PROTECTED]> wrote:
>
> > I think Huet's Zipper is intended to solve this sort of problem.
> >
> > data Path = Top | BranchL Path Tree | BranchR Tree Path
> > type Zipper = (Path, Tree)
> >
> > openZipper :: Tree -> Zipper
> > op
Hi,
> I think Huet's Zipper is intended to solve this sort of problem.
>
> data Path = Top | BranchL Path Tree | BranchR Tree Path
> type Zipper = (Path, Tree)
>
> openZipper :: Tree -> Zipper
> openZipper t = (Top, t)
>
> Conceptually the zipper is a tree with one subtree selected. You
On Thu, May 1, 2008 at 4:10 PM, Daniil Elovkov
<[EMAIL PROTECTED]> wrote:
> Felipe Lessa wrote:
>
> > On Thu, May 1, 2008 at 9:44 AM, Felipe Lessa <[EMAIL PROTECTED]>
> wrote:
> >
> > > On Thu, May 1, 2008 at 9:32 AM, Edsko de Vries <[EMAIL PROTECTED]>
> wrote:
> > > > So then the question become
On Fri, 2008-05-02 at 00:10 +0400, Daniil Elovkov wrote:
> Felipe Lessa wrote:
> > On Thu, May 1, 2008 at 9:44 AM, Felipe Lessa <[EMAIL PROTECTED]> wrote:
> >> On Thu, May 1, 2008 at 9:32 AM, Edsko de Vries <[EMAIL PROTECTED]> wrote:
> >> > So then the question becomes: what *is* the best way to
Felipe Lessa wrote:
On Thu, May 1, 2008 at 9:44 AM, Felipe Lessa <[EMAIL PROTECTED]> wrote:
On Thu, May 1, 2008 at 9:32 AM, Edsko de Vries <[EMAIL PROTECTED]> wrote:
> So then the question becomes: what *is* the best way to write this function?
I guess it would be simpler to have the counter
On Thu, May 1, 2008 at 9:44 AM, Felipe Lessa <[EMAIL PROTECTED]> wrote:
> On Thu, May 1, 2008 at 9:32 AM, Edsko de Vries <[EMAIL PROTECTED]> wrote:
> > So then the question becomes: what *is* the best way to write this
> function?
>
> I guess it would be simpler to have the counter on the data
On Thu, May 1, 2008 at 9:32 AM, Edsko de Vries <[EMAIL PROTECTED]> wrote:
> So then the question becomes: what *is* the best way to write this function?
I guess it would be simpler to have the counter on the data type and a
smart branch constructor:
> data Tree = Leaf Integer | Branch Integer Tr
Hi,
Thanks to Miguel for pointing out my silly error. So at least my
understanding of tail recursion is correct :) So then the question
becomes: what *is* the best way to write this function? One version I
can think of is
> ecount :: [Tree] -> Integer -> Integer
> ecount [] acc =