Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kseo/text-zipper-monad

Monadic interface to the text-zipper package
https://github.com/kseo/text-zipper-monad

Last synced: 26 days ago
JSON representation

Monadic interface to the text-zipper package

Awesome Lists containing this project

README

        

# text-zipper-monad

[![Hackage](https://img.shields.io/hackage/v/text-zipper-monad.svg?style=flat)](https://hackage.haskell.org/package/text-zipper-monad)
[![Build Status](https://travis-ci.org/kseo/text-zipper-monad.svg?branch=master)](https://travis-ci.org/kseo/text-zipper-monad)

text-zipper-monad provides a monadic interface to the text-zipper package.

## Usage

```haskell
import Data.Text.Zipper
import qualified Data.Text.Zipper.Edit as Z

insertXAtTheBeginning = do
Z.moveCursor (0, 0)
Z.insertChar 'x'

main = do
let tz = stringZipper ["abc", "def"] Nothing
newTz = Z.execEdit insertXAtTheBeginning tz
putStrLn (unlines (getText newTz))
```