text-zipper 0.4 → 0.5
raw patch · 2 files changed
+19/−2 lines, 2 filesdep +deepseq
Dependencies added: deepseq
Files
- src/Data/Text/Zipper.hs +15/−0
- text-zipper.cabal +4/−2
src/Data/Text/Zipper.hs view
@@ -30,6 +30,7 @@ , insertChar , breakLine , killToEOL+ , killToBOL , gotoEOL , gotoBOL , deletePrevChar@@ -42,6 +43,7 @@ where import Control.Applicative ((<$>))+import Control.DeepSeq import Data.Monoid import qualified Data.Text as T import qualified Data.Vector as V@@ -61,6 +63,13 @@ , lineLimit :: Maybe Int } +instance (NFData a) => NFData (TextZipper a) where+ rnf z = (toLeft z) `deepseq`+ (toRight z) `deepseq`+ (above z) `deepseq`+ (below z) `deepseq`+ ()+ -- | Get the line limit, if any, for a zipper. getLineLimit :: TextZipper a -> Maybe Int getLineLimit = lineLimit@@ -207,6 +216,12 @@ } | otherwise = tz { toRight = mempty }++-- |Remove all text from the cursor position to the beginning of the+-- current line.+killToBOL :: Monoid a => TextZipper a -> TextZipper a+killToBOL tz = tz { toLeft = mempty+ } -- |Delete the character preceding the cursor position, and move the -- cursor backwards by one character.
text-zipper.cabal view
@@ -1,5 +1,5 @@ name: text-zipper-version: 0.4+version: 0.5 synopsis: A text editor zipper library description: This library provides a zipper and API for editing text. license: BSD3@@ -21,6 +21,8 @@ build-depends: base < 5, text,- vector+ vector,+ deepseq+ ghc-options: -Wall hs-source-dirs: src default-language: Haskell2010