bytepatch-0.3.1: Patch byte-representable data in a bytestream.
Safe HaskellNone
LanguageHaskell2010

StreamPatch.Patch

Description

Core patch type definitions: patches, seeks, metadata.

Synopsis

Documentation

data Patch s fs a Source #

Constructors

Patch 

Fields

Instances

Instances details
Functor (FunctorRec fs) => Functor (Patch s fs) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

fmap :: (a -> b) -> Patch s fs a -> Patch s fs b #

(<$) :: a -> Patch s fs b -> Patch s fs a #

(Eq a, Eq (SeekRep s), Eq (Rec (Flap a) fs)) => Eq (Patch s fs a) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

(==) :: Patch s fs a -> Patch s fs a -> Bool #

(/=) :: Patch s fs a -> Patch s fs a -> Bool #

(Show a, Show (SeekRep s), ReifyConstraint Show (Flap a) fs, RMap fs, RecordToList fs) => Show (Patch s fs a) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

showsPrec :: Int -> Patch s fs a -> ShowS #

show :: Patch s fs a -> String #

showList :: [Patch s fs a] -> ShowS #

Generic (Patch s fs a) Source # 
Instance details

Defined in StreamPatch.Patch

Associated Types

type Rep (Patch s fs a) :: Type -> Type #

Methods

from :: Patch s fs a -> Rep (Patch s fs a) x #

to :: Rep (Patch s fs a) x -> Patch s fs a #

type Rep (Patch s fs a) Source # 
Instance details

Defined in StreamPatch.Patch

type Rep (Patch s fs a) = D1 ('MetaData "Patch" "StreamPatch.Patch" "bytepatch-0.3.1-inplace" 'False) (C1 ('MetaCons "Patch" 'PrefixI 'True) (S1 ('MetaSel ('Just "patchData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: (S1 ('MetaSel ('Just "patchSeek") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SeekRep s)) :*: S1 ('MetaSel ('Just "patchMeta") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (FunctorRec fs a)))))

newtype Flap a f Source #

Constructors

Flap 

Fields

Instances

Instances details
Eq (f a) => Eq (Flap a f) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

(==) :: Flap a f -> Flap a f -> Bool #

(/=) :: Flap a f -> Flap a f -> Bool #

Show (f a) => Show (Flap a f) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

showsPrec :: Int -> Flap a f -> ShowS #

show :: Flap a f -> String #

showList :: [Flap a f] -> ShowS #

Generic (Flap a f) Source # 
Instance details

Defined in StreamPatch.Patch

Associated Types

type Rep (Flap a f) :: Type -> Type #

Methods

from :: Flap a f -> Rep (Flap a f) x #

to :: Rep (Flap a f) x -> Flap a f #

type Rep (Flap a f) Source # 
Instance details

Defined in StreamPatch.Patch

type Rep (Flap a f) = D1 ('MetaData "Flap" "StreamPatch.Patch" "bytepatch-0.3.1-inplace" 'True) (C1 ('MetaCons "Flap" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFlap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

newtype FunctorRec fs a Source #

Constructors

FunctorRec 

Fields

Instances

Instances details
(Functor r, Functor (FunctorRec rs)) => Functor (FunctorRec (r ': rs)) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

fmap :: (a -> b) -> FunctorRec (r ': rs) a -> FunctorRec (r ': rs) b #

(<$) :: a -> FunctorRec (r ': rs) b -> FunctorRec (r ': rs) a #

Functor (FunctorRec ('[] :: [Type -> Type])) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

fmap :: (a -> b) -> FunctorRec '[] a -> FunctorRec '[] b #

(<$) :: a -> FunctorRec '[] b -> FunctorRec '[] a #

(Applicative r, Applicative (FunctorRec rs)) => Applicative (FunctorRec (r ': rs)) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

pure :: a -> FunctorRec (r ': rs) a #

(<*>) :: FunctorRec (r ': rs) (a -> b) -> FunctorRec (r ': rs) a -> FunctorRec (r ': rs) b #

liftA2 :: (a -> b -> c) -> FunctorRec (r ': rs) a -> FunctorRec (r ': rs) b -> FunctorRec (r ': rs) c #

(*>) :: FunctorRec (r ': rs) a -> FunctorRec (r ': rs) b -> FunctorRec (r ': rs) b #

(<*) :: FunctorRec (r ': rs) a -> FunctorRec (r ': rs) b -> FunctorRec (r ': rs) a #

Applicative (FunctorRec ('[] :: [Type -> Type])) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

pure :: a -> FunctorRec '[] a #

(<*>) :: FunctorRec '[] (a -> b) -> FunctorRec '[] a -> FunctorRec '[] b #

liftA2 :: (a -> b -> c) -> FunctorRec '[] a -> FunctorRec '[] b -> FunctorRec '[] c #

(*>) :: FunctorRec '[] a -> FunctorRec '[] b -> FunctorRec '[] b #

(<*) :: FunctorRec '[] a -> FunctorRec '[] b -> FunctorRec '[] a #

(Foldable r, Foldable (FunctorRec rs)) => Foldable (FunctorRec (r ': rs)) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

fold :: Monoid m => FunctorRec (r ': rs) m -> m #

foldMap :: Monoid m => (a -> m) -> FunctorRec (r ': rs) a -> m #

foldMap' :: Monoid m => (a -> m) -> FunctorRec (r ': rs) a -> m #

foldr :: (a -> b -> b) -> b -> FunctorRec (r ': rs) a -> b #

foldr' :: (a -> b -> b) -> b -> FunctorRec (r ': rs) a -> b #

foldl :: (b -> a -> b) -> b -> FunctorRec (r ': rs) a -> b #

foldl' :: (b -> a -> b) -> b -> FunctorRec (r ': rs) a -> b #

foldr1 :: (a -> a -> a) -> FunctorRec (r ': rs) a -> a #

foldl1 :: (a -> a -> a) -> FunctorRec (r ': rs) a -> a #

toList :: FunctorRec (r ': rs) a -> [a] #

null :: FunctorRec (r ': rs) a -> Bool #

length :: FunctorRec (r ': rs) a -> Int #

elem :: Eq a => a -> FunctorRec (r ': rs) a -> Bool #

maximum :: Ord a => FunctorRec (r ': rs) a -> a #

minimum :: Ord a => FunctorRec (r ': rs) a -> a #

sum :: Num a => FunctorRec (r ': rs) a -> a #

product :: Num a => FunctorRec (r ': rs) a -> a #

Foldable (FunctorRec ('[] :: [Type -> Type])) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

fold :: Monoid m => FunctorRec '[] m -> m #

foldMap :: Monoid m => (a -> m) -> FunctorRec '[] a -> m #

foldMap' :: Monoid m => (a -> m) -> FunctorRec '[] a -> m #

foldr :: (a -> b -> b) -> b -> FunctorRec '[] a -> b #

foldr' :: (a -> b -> b) -> b -> FunctorRec '[] a -> b #

foldl :: (b -> a -> b) -> b -> FunctorRec '[] a -> b #

foldl' :: (b -> a -> b) -> b -> FunctorRec '[] a -> b #

foldr1 :: (a -> a -> a) -> FunctorRec '[] a -> a #

foldl1 :: (a -> a -> a) -> FunctorRec '[] a -> a #

toList :: FunctorRec '[] a -> [a] #

null :: FunctorRec '[] a -> Bool #

length :: FunctorRec '[] a -> Int #

elem :: Eq a => a -> FunctorRec '[] a -> Bool #

maximum :: Ord a => FunctorRec '[] a -> a #

minimum :: Ord a => FunctorRec '[] a -> a #

sum :: Num a => FunctorRec '[] a -> a #

product :: Num a => FunctorRec '[] a -> a #

(Traversable r, Traversable (FunctorRec rs)) => Traversable (FunctorRec (r ': rs)) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

traverse :: Applicative f => (a -> f b) -> FunctorRec (r ': rs) a -> f (FunctorRec (r ': rs) b) #

sequenceA :: Applicative f => FunctorRec (r ': rs) (f a) -> f (FunctorRec (r ': rs) a) #

mapM :: Monad m => (a -> m b) -> FunctorRec (r ': rs) a -> m (FunctorRec (r ': rs) b) #

sequence :: Monad m => FunctorRec (r ': rs) (m a) -> m (FunctorRec (r ': rs) a) #

Traversable (FunctorRec ('[] :: [Type -> Type])) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

traverse :: Applicative f => (a -> f b) -> FunctorRec '[] a -> f (FunctorRec '[] b) #

sequenceA :: Applicative f => FunctorRec '[] (f a) -> f (FunctorRec '[] a) #

mapM :: Monad m => (a -> m b) -> FunctorRec '[] a -> m (FunctorRec '[] b) #

sequence :: Monad m => FunctorRec '[] (m a) -> m (FunctorRec '[] a) #

Eq (Rec (Flap a) fs) => Eq (FunctorRec fs a) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

(==) :: FunctorRec fs a -> FunctorRec fs a -> Bool #

(/=) :: FunctorRec fs a -> FunctorRec fs a -> Bool #

(ReifyConstraint Show (Flap a) fs, RMap fs, RecordToList fs) => Show (FunctorRec fs a) Source # 
Instance details

Defined in StreamPatch.Patch

Methods

showsPrec :: Int -> FunctorRec fs a -> ShowS #

show :: FunctorRec fs a -> String #

showList :: [FunctorRec fs a] -> ShowS #

Generic (FunctorRec fs a) Source # 
Instance details

Defined in StreamPatch.Patch

Associated Types

type Rep (FunctorRec fs a) :: Type -> Type #

Methods

from :: FunctorRec fs a -> Rep (FunctorRec fs a) x #

to :: Rep (FunctorRec fs a) x -> FunctorRec fs a #

type Rep (FunctorRec fs a) Source # 
Instance details

Defined in StreamPatch.Patch

type Rep (FunctorRec fs a) = D1 ('MetaData "FunctorRec" "StreamPatch.Patch" "bytepatch-0.3.1-inplace" 'True) (C1 ('MetaCons "FunctorRec" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFunctorRec") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Rec (Flap a) fs))))

data SeekKind Source #

What a patch seek value means.

Constructors

FwdSeek

seeks only move cursor forward

RelSeek

seeks are relative e.g. to a universal base, or a stream cursor

AbsSeek

seeks specify an exact offset in stream

Instances

Instances details
Eq SeekKind Source # 
Instance details

Defined in StreamPatch.Patch

Show SeekKind Source # 
Instance details

Defined in StreamPatch.Patch

Generic SeekKind Source # 
Instance details

Defined in StreamPatch.Patch

Associated Types

type Rep SeekKind :: Type -> Type #

Methods

from :: SeekKind -> Rep SeekKind x #

to :: Rep SeekKind x -> SeekKind #

type Rep SeekKind Source # 
Instance details

Defined in StreamPatch.Patch

type Rep SeekKind = D1 ('MetaData "SeekKind" "StreamPatch.Patch" "bytepatch-0.3.1-inplace" 'False) (C1 ('MetaCons "FwdSeek" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RelSeek" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AbsSeek" 'PrefixI 'False) (U1 :: Type -> Type)))

type family SeekRep (s :: SeekKind) where ... Source #

Get the representation for a SeekKind. Allows us a bit more safety.