zipper Questions

1

Let's define a tree T: A / \ B C / \ D E Let's say a new node is added to E, yielding T': A / \ B C / \ D E \ G In a mutable language this is an easy task - just update E's children...
Aberdeen asked 26/1, 2012 at 23:11

1

Solved

Oleg Kiselyov showed how to make a zipper from any traversable by using delimited continuations. His Haskell code is quite short: module ZipperTraversable where import qualified Data.Traversable...
Knur asked 11/4, 2013 at 3:52

2

Problem I've been wondering how this could be done efficiently for a while, but for some reason I have been unable to do it. I need to model a rectangular grid, where each field contains some data....
Cobaltite asked 8/4, 2013 at 8:19

1

I'm writing a graphical editor for a "model" (i.e. a collection of boxes and lines with some kind of semantics, such as UML, the details of which don't matter here). So I want to have a data struct...
Finke asked 9/9, 2012 at 14:12

2

Solved

I'm reading Huet Zipper, I cannot understand the go_up method: let go_up (Loc(t,p)) = match p with Top -> failwith "up of top" | Node(left,up,right) -> Loc(Section((rev left) @ (t::right)),u...
Edacity asked 26/8, 2012 at 10:15

2

I have a few ADT's that represent a simple geometry tree in Haskell. Something about having my operation types separate from the tree structure is bothering me. I'm thinking of making the Tree type...
Skinhead asked 22/8, 2012 at 5:58

1

Solved

I am struggling with existential types in my program. I think I'm trying to do something very reasonable however I cannot get past the typechecker :( I have a datatype that sort of mimics a Monad ...
Aristides asked 25/11, 2011 at 21:12

2

Solved

The Zipper data structure is great when one wants to traverse a tree and keep the current position, but what data structure one should use if they want to track more then one position? Let me expl...

1

Solved

I think that the zipper is a beautiful idea; it elegantly provides a way to walk a list or tree and make what appear to be local updates in a functional way. Asymptotically, the costs appear to be...

2

Solved

Lets suppose we have some XML like so: <a> <b> <c>text</c> <d> <e>text</e> <f> ... lots of cruft here .. </f> </d> </b> ...
Titus asked 9/1, 2010 at 19:4

© 2022 - 2024 — McMap. All rights reserved.