Zipper - HaskellWiki

Personal tools Home Log in ?php $this->data['sitenotice'] = 'This is a test instance. Do not edit, your changes will be lost.'; ? Views Page Discussion View source History Jump to: navigation , search start content The Zipper is an idiom that uses the idea of “context” to the means of manipulating locations in a data structure. Zipper monad is a monad which implements the zipper for binary trees. 1 Automation 2 Alternative formulation 3 Comonads and monads 4 Applications 5 Further reading Sometimes you want to manipulate a location inside a data structure, rather than the data itself. For example, consider a simple binary tree type: data Tree a = Fork ( Tree a ) ( Tree a ) | Leaf a and a sample tree t: t = Fork ( Fork ( Leaf 1 ) ( Leaf 2 ) ) ( Fork ( Leaf 3 ) ( Leaf 4 ) ) Each subtree of this tree occupies a certain l...

Linked on 2014-11-24 22:19:56 | Similar Links