patch-0.0.8.0: Data structures for describing changes to other data structures.

Safe HaskellNone
LanguageHaskell2010

Data.Patch.PatchOrReplacement

Description

 
Synopsis

Documentation

data PatchOrReplacement p Source #

Either a patch or a replacement value.

A good patch type will describe small changes very efficiently, but that often comes at the cost of describing large change rather inefficiently. PatchOrReplacement can be used as an escape hatch: when the change as a patch would be too big, just provide a new value to replace the old one with instead.

Since: 0.0.6

Instances
(Eq p, Eq (PatchTarget p)) => Eq (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

(Ord p, Ord (PatchTarget p)) => Ord (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

(Read p, Read (PatchTarget p)) => Read (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

(Show p, Show (PatchTarget p)) => Show (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

Generic (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

Associated Types

type Rep (PatchOrReplacement p) :: Type -> Type #

(Semigroup p, Patch p) => Semigroup (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

(Monoid p, Patch p) => Monoid (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

Patch p => Patch (PatchOrReplacement p) Source #

To apply a PatchOrReplacement p apply the the underlying p or substitute the replacement PatchTarget p.

Instance details

Defined in Data.Patch.PatchOrReplacement

Associated Types

type PatchTarget (PatchOrReplacement p) :: Type Source #

type Rep (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

type Rep (PatchOrReplacement p) = D1 (MetaData "PatchOrReplacement" "Data.Patch.PatchOrReplacement" "patch-0.0.8.0-inplace" False) (C1 (MetaCons "PatchOrReplacement_Patch" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 p)) :+: C1 (MetaCons "PatchOrReplacement_Replacement" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (PatchTarget p))))
type PatchTarget (PatchOrReplacement p) Source # 
Instance details

Defined in Data.Patch.PatchOrReplacement

traversePatchOrReplacement :: Functor f => (a -> f b) -> (PatchTarget a -> f (PatchTarget b)) -> PatchOrReplacement a -> f (PatchOrReplacement b) Source #

Traverse a PatchOrReplacement with a function for each case