yi-language-0.19.2: Collection of language-related Yi libraries.

Safe Haskell | None
Language | Haskell2010

Yi.Buffer.Basic

Description

Basic types useful everywhere we play with buffers.

Synopsis

- data Direction
  - = Backward
  - | Forward
- reverseDir :: Direction -> Direction
- mayReverse :: Direction -> [a] -> [a]
- directionElim :: Direction -> a -> a -> a
- newtype Mark = Mark {
  - markId :: Int
  }
- newtype BufferRef = BufferRef Int
- newtype Point = Point {
  - fromPoint :: Int
  }
- newtype Size = Size {
  - fromSize :: Int
  }
- newtype WindowRef = WindowRef {
  - unWindowRef :: Int
  }

# Documentation

data Direction Source #

Direction of movement inside a buffer

Constructors

Backward |
Forward |

#### Instances

Instances details

Binary Direction Source # |
Instance details Defined in Yi.Buffer.Basic Methods put :: Direction -> Put Source # get :: Get Direction Source # putList :: [Direction] -> Put Source #
Bounded Direction Source # |
Instance details Defined in Yi.Buffer.Basic Methods minBound :: Direction Source # maxBound :: Direction Source #
Enum Direction Source # |

Instance details

Defined in Yi.Buffer.Basic

Methods

succ :: Direction -> Direction Source #

pred :: Direction -> Direction Source #

toEnum :: Int -> Direction Source #

fromEnum :: Direction -> Int Source #

enumFrom :: Direction -> [Direction] Source #

enumFromThen :: Direction -> Direction -> [Direction] Source #

enumFromTo :: Direction -> Direction -> [Direction] Source #

enumFromThenTo :: Direction -> Direction -> Direction -> [Direction] Source #

Generic Direction Source # |

Instance details

Defined in Yi.Buffer.Basic

Associated Types

type Rep Direction |
Instance details Defined in Yi.Buffer.Basic type Rep Direction = D1 ('MetaData "Direction" "Yi.Buffer.Basic" "yi-language-0.19.2-9aqnsb1TqRMA1LJA09MZJx" 'False) (C1 ('MetaCons "Backward" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Forward" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Direction -> Rep Direction x Source #

to :: Rep Direction x -> Direction Source #

Show Direction Source # |
Instance details Defined in Yi.Buffer.Basic Methods showsPrec :: Int -> Direction -> ShowS Source # show :: Direction -> String Source # showList :: [Direction] -> ShowS Source #
Eq Direction Source # |
Instance details Defined in Yi.Buffer.Basic Methods (==) :: Direction -> Direction -> Bool Source # (/=) :: Direction -> Direction -> Bool Source #
Ord Direction Source # |
Instance details Defined in Yi.Buffer.Basic Methods compare :: Direction -> Direction -> Ordering Source # (<) :: Direction -> Direction -> Bool Source # (<=) :: Direction -> Direction -> Bool Source # (>) :: Direction -> Direction -> Bool Source # (>=) :: Direction -> Direction -> Bool Source # max :: Direction -> Direction -> Direction Source # min :: Direction -> Direction -> Direction Source #
type Rep Direction Source # |
Instance details Defined in Yi.Buffer.Basic type Rep Direction = D1 ('MetaData "Direction" "Yi.Buffer.Basic" "yi-language-0.19.2-9aqnsb1TqRMA1LJA09MZJx" 'False) (C1 ('MetaCons "Backward" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Forward" 'PrefixI 'False) (U1 :: Type -> Type))

reverseDir :: Direction -> Direction Source #

mayReverse :: Direction -> [a] -> [a] Source #

reverse if Backward

directionElim :: Direction -> a -> a -> a Source #

`direction` is in the same style of `maybe` or `either` functions, It takes one argument per direction (backward, then forward) and a direction to select the output.

newtype Mark Source #

A mark in a buffer

Constructors

Mark |

Fields

- markId :: Int

#### Instances

Instances details

Binary Mark Source # |
Instance details Defined in Yi.Buffer.Basic Methods put :: Mark -> Put Source # get :: Get Mark Source # putList :: [Mark] -> Put Source #
Show Mark Source # |
Instance details Defined in Yi.Buffer.Basic Methods showsPrec :: Int -> Mark -> ShowS Source # show :: Mark -> String Source # showList :: [Mark] -> ShowS Source #
Eq Mark Source # |
Instance details Defined in Yi.Buffer.Basic Methods (==) :: Mark -> Mark -> Bool Source # (/=) :: Mark -> Mark -> Bool Source #
Ord Mark Source # |
Instance details Defined in Yi.Buffer.Basic Methods compare :: Mark -> Mark -> Ordering Source # (<) :: Mark -> Mark -> Bool Source # (<=) :: Mark -> Mark -> Bool Source # (>) :: Mark -> Mark -> Bool Source # (>=) :: Mark -> Mark -> Bool Source # max :: Mark -> Mark -> Mark Source # min :: Mark -> Mark -> Mark Source #

newtype BufferRef Source #

Reference to a buffer.

Constructors

BufferRef Int |

#### Instances

Instances details

Binary BufferRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods put :: BufferRef -> Put Source # get :: Get BufferRef Source # putList :: [BufferRef] -> Put Source #
Num BufferRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods (+) :: BufferRef -> BufferRef -> BufferRef Source # (-) :: BufferRef -> BufferRef -> BufferRef Source # (*) :: BufferRef -> BufferRef -> BufferRef Source # negate :: BufferRef -> BufferRef Source # abs :: BufferRef -> BufferRef Source # signum :: BufferRef -> BufferRef Source # fromInteger :: Integer -> BufferRef Source #
Show BufferRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods showsPrec :: Int -> BufferRef -> ShowS Source # show :: BufferRef -> String Source # showList :: [BufferRef] -> ShowS Source #
Eq BufferRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods (==) :: BufferRef -> BufferRef -> Bool Source # (/=) :: BufferRef -> BufferRef -> Bool Source #
Ord BufferRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods compare :: BufferRef -> BufferRef -> Ordering Source # (<) :: BufferRef -> BufferRef -> Bool Source # (<=) :: BufferRef -> BufferRef -> Bool Source # (>) :: BufferRef -> BufferRef -> Bool Source # (>=) :: BufferRef -> BufferRef -> Bool Source # max :: BufferRef -> BufferRef -> BufferRef Source # min :: BufferRef -> BufferRef -> BufferRef Source #

newtype Point Source #

A point in a buffer

Constructors

Point |

Fields

- fromPoint :: Int

#### Instances

Instances details

Binary Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods put :: Point -> Put Source # get :: Get Point Source # putList :: [Point] -> Put Source #
Bounded Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods minBound :: Point Source # maxBound :: Point Source #
Enum Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods succ :: Point -> Point Source # pred :: Point -> Point Source # toEnum :: Int -> Point Source # fromEnum :: Point -> Int Source # enumFrom :: Point -> [Point] Source # enumFromThen :: Point -> Point -> [Point] Source # enumFromTo :: Point -> Point -> [Point] Source # enumFromThenTo :: Point -> Point -> Point -> [Point] Source #
Ix Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods range :: (Point, Point) -> [Point] Source # index :: (Point, Point) -> Point -> Int Source # unsafeIndex :: (Point, Point) -> Point -> Int Source # inRange :: (Point, Point) -> Point -> Bool Source # rangeSize :: (Point, Point) -> Int Source # unsafeRangeSize :: (Point, Point) -> Int Source #
Num Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods (+) :: Point -> Point -> Point Source # (-) :: Point -> Point -> Point Source # (*) :: Point -> Point -> Point Source # negate :: Point -> Point Source # abs :: Point -> Point Source # signum :: Point -> Point Source # fromInteger :: Integer -> Point Source #
Integral Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods quot :: Point -> Point -> Point Source # rem :: Point -> Point -> Point Source # div :: Point -> Point -> Point Source # mod :: Point -> Point -> Point Source # quotRem :: Point -> Point -> (Point, Point) Source # divMod :: Point -> Point -> (Point, Point) Source # toInteger :: Point -> Integer Source #
Real Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods toRational :: Point -> Rational Source #
Show Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods showsPrec :: Int -> Point -> ShowS Source # show :: Point -> String Source # showList :: [Point] -> ShowS Source #
Eq Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods (==) :: Point -> Point -> Bool Source # (/=) :: Point -> Point -> Bool Source #
Ord Point Source # |
Instance details Defined in Yi.Buffer.Basic Methods compare :: Point -> Point -> Ordering Source # (<) :: Point -> Point -> Bool Source # (<=) :: Point -> Point -> Bool Source # (>) :: Point -> Point -> Bool Source # (>=) :: Point -> Point -> Bool Source # max :: Point -> Point -> Point Source # min :: Point -> Point -> Point Source #
SemiNum Point Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods (+~) :: Point -> Size -> Point Source # (-~) :: Point -> Size -> Point Source # (~-) :: Point -> Point -> Size Source #

newtype Size Source #

Size of a buffer region

Constructors

Size |

Fields

- fromSize :: Int

#### Instances

Instances details

Binary Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods put :: Size -> Put Source # get :: Get Size Source # putList :: [Size] -> Put Source #
Enum Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods succ :: Size -> Size Source # pred :: Size -> Size Source # toEnum :: Int -> Size Source # fromEnum :: Size -> Int Source # enumFrom :: Size -> [Size] Source # enumFromThen :: Size -> Size -> [Size] Source # enumFromTo :: Size -> Size -> [Size] Source # enumFromThenTo :: Size -> Size -> Size -> [Size] Source #
Num Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods (+) :: Size -> Size -> Size Source # (-) :: Size -> Size -> Size Source # (*) :: Size -> Size -> Size Source # negate :: Size -> Size Source # abs :: Size -> Size Source # signum :: Size -> Size Source # fromInteger :: Integer -> Size Source #
Integral Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods quot :: Size -> Size -> Size Source # rem :: Size -> Size -> Size Source # div :: Size -> Size -> Size Source # mod :: Size -> Size -> Size Source # quotRem :: Size -> Size -> (Size, Size) Source # divMod :: Size -> Size -> (Size, Size) Source # toInteger :: Size -> Integer Source #
Real Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods toRational :: Size -> Rational Source #
Show Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods showsPrec :: Int -> Size -> ShowS Source # show :: Size -> String Source # showList :: [Size] -> ShowS Source #
Eq Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods (==) :: Size -> Size -> Bool Source # (/=) :: Size -> Size -> Bool Source #
Ord Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods compare :: Size -> Size -> Ordering Source # (<) :: Size -> Size -> Bool Source # (<=) :: Size -> Size -> Bool Source # (>) :: Size -> Size -> Bool Source # (>=) :: Size -> Size -> Bool Source # max :: Size -> Size -> Size Source # min :: Size -> Size -> Size Source #
SemiNum Point Size Source # |
Instance details Defined in Yi.Buffer.Basic Methods (+~) :: Point -> Size -> Point Source # (-~) :: Point -> Size -> Point Source # (~-) :: Point -> Point -> Size Source #

newtype WindowRef Source #

Window references

Constructors

WindowRef |

Fields

- unWindowRef :: Int

#### Instances

Instances details

Binary WindowRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods put :: WindowRef -> Put Source # get :: Get WindowRef Source # putList :: [WindowRef] -> Put Source #
Default WindowRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods def :: WindowRef Source #
Enum WindowRef Source # |

Instance details

Defined in Yi.Buffer.Basic

Methods

succ :: WindowRef -> WindowRef Source #

pred :: WindowRef -> WindowRef Source #

toEnum :: Int -> WindowRef Source #

fromEnum :: WindowRef -> Int Source #

enumFrom :: WindowRef -> [WindowRef] Source #

enumFromThen :: WindowRef -> WindowRef -> [WindowRef] Source #

enumFromTo :: WindowRef -> WindowRef -> [WindowRef] Source #

enumFromThenTo :: WindowRef -> WindowRef -> WindowRef -> [WindowRef] Source #

Show WindowRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods showsPrec :: Int -> WindowRef -> ShowS Source # show :: WindowRef -> String Source # showList :: [WindowRef] -> ShowS Source #
Eq WindowRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods (==) :: WindowRef -> WindowRef -> Bool Source # (/=) :: WindowRef -> WindowRef -> Bool Source #
Ord WindowRef Source # |
Instance details Defined in Yi.Buffer.Basic Methods compare :: WindowRef -> WindowRef -> Ordering Source # (<) :: WindowRef -> WindowRef -> Bool Source # (<=) :: WindowRef -> WindowRef -> Bool Source # (>) :: WindowRef -> WindowRef -> Bool Source # (>=) :: WindowRef -> WindowRef -> Bool Source # max :: WindowRef -> WindowRef -> WindowRef Source # min :: WindowRef -> WindowRef -> WindowRef Source #