Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PatchOrReplacement p
- _PatchOrReplacement_Patch :: forall p. Prism' (PatchOrReplacement p) p
- _PatchOrReplacement_Replacement :: forall p. Prism' (PatchOrReplacement p) (PatchTarget p)
- traversePatchOrReplacement :: Functor f => (a -> f b) -> (PatchTarget a -> f (PatchTarget b)) -> PatchOrReplacement a -> f (PatchOrReplacement b)
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
_PatchOrReplacement_Patch :: forall p. Prism' (PatchOrReplacement p) p Source #
_PatchOrReplacement_Replacement :: forall p. Prism' (PatchOrReplacement p) (PatchTarget p) Source #
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