bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Safe HaskellSafe
LanguageHaskell98

Bitcoin.Misc.Zipper

Description

Simple zipper data structure

Synopsis

Documentation

data Zipper a Source #

A linear zipper, where the focus can be optionally after the last element (but not before the first element). That is, the focus is the first element (if exists) of the second list.

Constructors

Zipper [a] [a] 

Instances

Show a => Show (Zipper a) Source # 

Methods

showsPrec :: Int -> Zipper a -> ShowS #

show :: Zipper a -> String #

showList :: [Zipper a] -> ShowS #

moveRight :: Zipper a -> Maybe (a, Zipper a) Source #

returns the focus before moving right

moveLeft :: Zipper a -> Maybe (a, Zipper a) Source #

returns the focus after moving left

mkZipper :: [a] -> [a] -> Zipper a Source #

zipperView :: Zipper a -> ([a], [a]) Source #

Head of the second list is the focus (if it is not empty)