module Unison.Merge.DiffOp
  ( DiffOp (..),
  )
where

import Unison.Merge.Updated (Updated)

-- | A diff operation is one of:
--
--   * An add (where nothing was)
--   * A delete (of the thing that was)
--   * An update (from old to new)
data DiffOp a
  = DiffOp'Add !a
  | DiffOp'Delete !a
  | DiffOp'Update !(Updated a)
  deriving stock ((forall a b. (a -> b) -> DiffOp a -> DiffOp b)
-> (forall a b. a -> DiffOp b -> DiffOp a) -> Functor DiffOp
forall a b. a -> DiffOp b -> DiffOp a
forall a b. (a -> b) -> DiffOp a -> DiffOp b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> DiffOp a -> DiffOp b
fmap :: forall a b. (a -> b) -> DiffOp a -> DiffOp b
$c<$ :: forall a b. a -> DiffOp b -> DiffOp a
<$ :: forall a b. a -> DiffOp b -> DiffOp a
Functor, Int -> DiffOp a -> ShowS
[DiffOp a] -> ShowS
DiffOp a -> String
(Int -> DiffOp a -> ShowS)
-> (DiffOp a -> String) -> ([DiffOp a] -> ShowS) -> Show (DiffOp a)
forall a. Show a => Int -> DiffOp a -> ShowS
forall a. Show a => [DiffOp a] -> ShowS
forall a. Show a => DiffOp a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> DiffOp a -> ShowS
showsPrec :: Int -> DiffOp a -> ShowS
$cshow :: forall a. Show a => DiffOp a -> String
show :: DiffOp a -> String
$cshowList :: forall a. Show a => [DiffOp a] -> ShowS
showList :: [DiffOp a] -> ShowS
Show)