Safe Haskell | None |
---|---|
Language | Haskell2010 |
- pt :: Int -> Int -> Point
- start :: Point
- lineStart :: Int -> Point
- regionLength :: Lens' Region Size
- till :: Point -> Point -> Region
- linesSize :: Int -> Size
- regionLines :: Lens' Region Int
- emptyRegion :: Region -> Bool
- line :: Int -> Region
- regionSize :: Point -> Size -> Region
- expandLines :: Region -> Region
- atRegion :: Editable s => Region -> Lens' (Contents s) (Contents s)
- class ApplyMap a where
- updateMap :: (EditAction e s, ApplyMap a) => e s -> a -> a
- cutMap :: Region -> Map
- insertMap :: Region -> Map
- cutRegion :: Region -> Region -> Region
- insertRegion :: Region -> Region -> Region
- class (Editable s, ApplyMap (e s)) => EditAction e s where
- cut :: EditAction e s => Region -> e s
- paste :: EditAction e s => Point -> Contents s -> e s
- overwrite :: EditAction e s => Point -> Contents s -> e s
- inverse :: EditAction e s => Contents s -> e s -> e s
- applyEdit :: EditAction e s => e s -> Contents s -> Contents s
- apply :: EditAction Replace s => Edit s -> Contents s -> Contents s
- edit :: EditAction Replace s => s -> r -> EditM s r a -> (a, s)
- edit_ :: EditAction Replace s => s -> r -> EditM s r a -> s
- push :: ActionIso (Edit s) -> EditM s r ()
- run_ :: (EditAction Replace s, ApplyMap r) => Edit s -> EditM s r (ActionIso (Edit s))
- run :: (EditAction Replace s, ApplyMap r) => Edit s -> EditM s r ()
- runGroup :: (EditAction Replace s, ApplyMap r) => [Edit s] -> EditM s r ()
- undo :: (EditAction Replace s, ApplyMap r) => EditM s r ()
- redo :: (EditAction Replace s, ApplyMap r) => EditM s r ()
- module Data.Text.Region.Types
Documentation
line :: Int -> Region Source #
n'th line region, starts at the beginning of line and ends on the next line
insertRegion :: Region -> Region -> Region Source #
Update second region position as if it was data inserted at first region
class (Editable s, ApplyMap (e s)) => EditAction e s where Source #
replace :: Region -> Contents s -> e s Source #
actionMap :: e s -> Map Source #
Make Map
from action
perform :: e s -> State (Contents s) (e s) Source #
Perform action, modifying Contents
and returning inverse (undo) action
Editable s => EditAction Replace s Source # | |
EditAction e s => EditAction (Chain e) s Source # | |
cut :: EditAction e s => Region -> e s Source #
Cuts region
inverse :: EditAction e s => Contents s -> e s -> e s Source #
Get undo-action
edit :: EditAction Replace s => s -> r -> EditM s r a -> (a, s) Source #
Run edit monad and return result with updated contents
edit_ :: EditAction Replace s => s -> r -> EditM s r a -> s Source #
Run edit monad and return updated contents
run_ :: (EditAction Replace s, ApplyMap r) => Edit s -> EditM s r (ActionIso (Edit s)) Source #
Run edit action and returns corresponding redo-undo action
run :: (EditAction Replace s, ApplyMap r) => Edit s -> EditM s r () Source #
Run edit action with updating undo/redo stack
runGroup :: (EditAction Replace s, ApplyMap r) => [Edit s] -> EditM s r () Source #
Run edit actions, updating undo/redo stack for each of them, but act like they was applied simultaneously
For example, cutting 1-st and then 3-rd letter:
run (cut first) >> run (cut third) -- 1234 -> 234 -> 23
runGroup [cut first, cut third] -- 1234 -> 234 -> 24
module Data.Text.Region.Types