packages feed

text-zipper 0.2.1 → 0.3

raw patch · 2 files changed

+10/−3 lines, 2 filesdep +vector

Dependencies added: vector

Files

src/Data/Text/Zipper.hs view
@@ -9,7 +9,7 @@ -- is to use 'mkZipper' and provide all of the functions required to -- manipulate the underlying text data. ----- Implementation using 'T.Text' and 'String' are provided.+-- Implementations using 'T.Text' and 'String' are provided. module Data.Text.Zipper     ( TextZipper @@ -42,6 +42,7 @@ import Control.Applicative ((<$>)) import Data.Monoid import qualified Data.Text as T+import qualified Data.Vector as V  data TextZipper a =     TZ { toLeft :: a@@ -323,6 +324,11 @@ stringZipper :: [String] -> Maybe Int -> TextZipper String stringZipper =     mkZipper (:[]) drop take length last init null++-- |Construct a zipper from vectors of characters.+vectorZipper :: [V.Vector Char] -> Maybe Int -> TextZipper (V.Vector Char)+vectorZipper =+    mkZipper V.singleton V.drop V.take V.length V.last V.init V.null  -- |Construct a zipper from 'T.Text' values. textZipper :: [T.Text] -> Maybe Int -> TextZipper T.Text
text-zipper.cabal view
@@ -1,5 +1,5 @@ name:                text-zipper-version:             0.2.1+version:             0.3 synopsis:            A text editor zipper library description:         This library provides a zipper and API for editing text. license:             BSD3@@ -20,6 +20,7 @@     Data.Text.Zipper    build-depends:       base < 5,-                       text+                       text,+                       vector   hs-source-dirs:      src   default-language:    Haskell2010