{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Darcs.Patch.V2.Prim ( Prim(..) ) where
import Prelude ()
import Darcs.Prelude
import Data.Coerce (coerce )
import Darcs.Patch.Annotate ( Annotate )
import Darcs.Patch.Apply ( Apply(..) )
import Darcs.Patch.Commute ( Commute )
import Darcs.Patch.FileHunk ( IsHunk )
import Darcs.Patch.Format
( PatchListFormat(..)
, ListFormat(ListFormatV2)
, FileNameFormat(NewFormat,UserFormat) )
import Darcs.Patch.Inspect ( PatchInspect )
import Darcs.Patch.Invert ( Invert )
import Darcs.Patch.Read ( ReadPatch(..) )
import Darcs.Patch.Repair ( RepairToFL(..) )
import Darcs.Patch.Show
( ShowPatchBasic(..)
, ShowPatchFor(..)
, ShowPatch(..)
, ShowContextPatch(..)
)
import Darcs.Patch.Summary ( plainSummaryPrim, plainSummaryPrims )
import Darcs.Patch.Witnesses.Eq ( Eq2 )
import Darcs.Patch.Witnesses.Show
( Show1(..), Show2(..)
, ShowDict(ShowDictClass)
, appPrec, showsPrec2
)
import Darcs.Patch.Witnesses.Sealed ( mapSeal )
import Darcs.Patch.Prim.Class
( PrimConstruct(..), PrimCanonize(..)
, PrimClassify(..), PrimDetails(..)
, PrimShow(..), PrimRead(..)
, PrimApply(..)
, PrimPatch, PrimPatchBase(..)
, FromPrim(..), ToFromPrim(..)
, PrimPatchCommon
)
import qualified Darcs.Patch.Prim.V1 as Base ( Prim )
newtype Prim x y = Prim { Prim x y -> Prim x y
unPrim :: Base.Prim x y } deriving
( Prim wX wY -> AnnotatedM ()
(forall wX wY. Prim wX wY -> AnnotatedM ()) -> Annotate Prim
forall wX wY. Prim wX wY -> AnnotatedM ()
forall (p :: * -> * -> *).
(forall wX wY. p wX wY -> AnnotatedM ()) -> Annotate p
annotate :: Prim wX wY -> AnnotatedM ()
$cannotate :: forall wX wY. Prim wX wY -> AnnotatedM ()
Annotate
, (:>) Prim Prim wX wY -> Maybe ((:>) Prim Prim wX wY)
(forall wX wY.
(:>) Prim Prim wX wY -> Maybe ((:>) Prim Prim wX wY))
-> Commute Prim
forall wX wY. (:>) Prim Prim wX wY -> Maybe ((:>) Prim Prim wX wY)
forall (p :: * -> * -> *).
(forall wX wY. (:>) p p wX wY -> Maybe ((:>) p p wX wY))
-> Commute p
commute :: (:>) Prim Prim wX wY -> Maybe ((:>) Prim Prim wX wY)
$ccommute :: forall wX wY. (:>) Prim Prim wX wY -> Maybe ((:>) Prim Prim wX wY)
Commute
, Prim wX wY -> Prim wY wX
(forall wX wY. Prim wX wY -> Prim wY wX) -> Invert Prim
forall wX wY. Prim wX wY -> Prim wY wX
forall (p :: * -> * -> *).
(forall wX wY. p wX wY -> p wY wX) -> Invert p
invert :: Prim wX wY -> Prim wY wX
$cinvert :: forall wX wY. Prim wX wY -> Prim wY wX
Invert
, Prim wX wY -> Maybe (FileHunk wX wY)
(forall wX wY. Prim wX wY -> Maybe (FileHunk wX wY)) -> IsHunk Prim
forall wX wY. Prim wX wY -> Maybe (FileHunk wX wY)
forall (p :: * -> * -> *).
(forall wX wY. p wX wY -> Maybe (FileHunk wX wY)) -> IsHunk p
isHunk :: Prim wX wY -> Maybe (FileHunk wX wY)
$cisHunk :: forall wX wY. Prim wX wY -> Maybe (FileHunk wX wY)
IsHunk
, Prim wA wB -> Prim wC wD -> Bool
Prim wA wB -> Prim wA wC -> EqCheck wB wC
Prim wA wC -> Prim wB wC -> EqCheck wA wB
(forall wA wB wC wD. Prim wA wB -> Prim wC wD -> Bool)
-> (forall wA wB wC. Prim wA wB -> Prim wA wC -> EqCheck wB wC)
-> (forall wA wC wB. Prim wA wC -> Prim wB wC -> EqCheck wA wB)
-> Eq2 Prim
forall wA wB wC. Prim wA wB -> Prim wA wC -> EqCheck wB wC
forall wA wC wB. Prim wA wC -> Prim wB wC -> EqCheck wA wB
forall wA wB wC wD. Prim wA wB -> Prim wC wD -> Bool
forall (p :: * -> * -> *).
(forall wA wB wC wD. p wA wB -> p wC wD -> Bool)
-> (forall wA wB wC. p wA wB -> p wA wC -> EqCheck wB wC)
-> (forall wA wC wB. p wA wC -> p wB wC -> EqCheck wA wB)
-> Eq2 p
=/\= :: Prim wA wC -> Prim wB wC -> EqCheck wA wB
$c=/\= :: forall wA wC wB. Prim wA wC -> Prim wB wC -> EqCheck wA wB
=\/= :: Prim wA wB -> Prim wA wC -> EqCheck wB wC
$c=\/= :: forall wA wB wC. Prim wA wB -> Prim wA wC -> EqCheck wB wC
unsafeCompare :: Prim wA wB -> Prim wC wD -> Bool
$cunsafeCompare :: forall wA wB wC wD. Prim wA wB -> Prim wC wD -> Bool
Eq2
, Prim wX wY -> [FilePath]
(ByteString -> Bool) -> Prim wX wY -> Bool
(forall wX wY. Prim wX wY -> [FilePath])
-> (forall wX wY. (ByteString -> Bool) -> Prim wX wY -> Bool)
-> PatchInspect Prim
forall wX wY. Prim wX wY -> [FilePath]
forall wX wY. (ByteString -> Bool) -> Prim wX wY -> Bool
forall (p :: * -> * -> *).
(forall wX wY. p wX wY -> [FilePath])
-> (forall wX wY. (ByteString -> Bool) -> p wX wY -> Bool)
-> PatchInspect p
hunkMatches :: (ByteString -> Bool) -> Prim wX wY -> Bool
$chunkMatches :: forall wX wY. (ByteString -> Bool) -> Prim wX wY -> Bool
listTouchedFiles :: Prim wX wY -> [FilePath]
$clistTouchedFiles :: forall wX wY. Prim wX wY -> [FilePath]
PatchInspect
, FL Prim wX wY -> m ()
(forall (m :: * -> *) wX wY.
ApplyMonad (ApplyState Prim) m =>
FL Prim wX wY -> m ())
-> PrimApply Prim
forall (m :: * -> *) wX wY.
ApplyMonad (ApplyState Prim) m =>
FL Prim wX wY -> m ()
forall (prim :: * -> * -> *).
(forall (m :: * -> *) wX wY.
ApplyMonad (ApplyState prim) m =>
FL prim wX wY -> m ())
-> PrimApply prim
applyPrimFL :: FL Prim wX wY -> m ()
$capplyPrimFL :: forall (m :: * -> *) wX wY.
ApplyMonad (ApplyState Prim) m =>
FL Prim wX wY -> m ()
PrimApply
, DiffAlgorithm -> FL Prim wX wY -> FL Prim wX wY
DiffAlgorithm -> Prim wX wY -> FL Prim wX wY
FL Prim wX wY -> FL Prim wX wY
FL Prim wX wY -> Maybe (FL Prim wX wY)
FL Prim wX wY -> FL Prim wX wY
(:>) Prim Prim wX wY -> Maybe (FL Prim wX wY)
(forall wX wY. FL Prim wX wY -> FL Prim wX wY)
-> (forall wX wY. FL Prim wX wY -> Maybe (FL Prim wX wY))
-> (forall wX wY. FL Prim wX wY -> FL Prim wX wY)
-> (forall wX wY. DiffAlgorithm -> Prim wX wY -> FL Prim wX wY)
-> (forall wX wY. DiffAlgorithm -> FL Prim wX wY -> FL Prim wX wY)
-> (forall wX wY. (:>) Prim Prim wX wY -> Maybe (FL Prim wX wY))
-> PrimCanonize Prim
forall wX wY. DiffAlgorithm -> FL Prim wX wY -> FL Prim wX wY
forall wX wY. DiffAlgorithm -> Prim wX wY -> FL Prim wX wY
forall wX wY. FL Prim wX wY -> Maybe (FL Prim wX wY)
forall wX wY. FL Prim wX wY -> FL Prim wX wY
forall wX wY. (:>) Prim Prim wX wY -> Maybe (FL Prim wX wY)
forall (prim :: * -> * -> *).
(forall wX wY. FL prim wX wY -> FL prim wX wY)
-> (forall wX wY. FL prim wX wY -> Maybe (FL prim wX wY))
-> (forall wX wY. FL prim wX wY -> FL prim wX wY)
-> (forall wX wY. DiffAlgorithm -> prim wX wY -> FL prim wX wY)
-> (forall wX wY. DiffAlgorithm -> FL prim wX wY -> FL prim wX wY)
-> (forall wX wY. (:>) prim prim wX wY -> Maybe (FL prim wX wY))
-> PrimCanonize prim
coalesce :: (:>) Prim Prim wX wY -> Maybe (FL Prim wX wY)
$ccoalesce :: forall wX wY. (:>) Prim Prim wX wY -> Maybe (FL Prim wX wY)
canonizeFL :: DiffAlgorithm -> FL Prim wX wY -> FL Prim wX wY
$ccanonizeFL :: forall wX wY. DiffAlgorithm -> FL Prim wX wY -> FL Prim wX wY
canonize :: DiffAlgorithm -> Prim wX wY -> FL Prim wX wY
$ccanonize :: forall wX wY. DiffAlgorithm -> Prim wX wY -> FL Prim wX wY
sortCoalesceFL :: FL Prim wX wY -> FL Prim wX wY
$csortCoalesceFL :: forall wX wY. FL Prim wX wY -> FL Prim wX wY
tryShrinkingInverse :: FL Prim wX wY -> Maybe (FL Prim wX wY)
$ctryShrinkingInverse :: forall wX wY. FL Prim wX wY -> Maybe (FL Prim wX wY)
tryToShrink :: FL Prim wX wY -> FL Prim wX wY
$ctryToShrink :: forall wX wY. FL Prim wX wY -> FL Prim wX wY
PrimCanonize
, Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Bool
Prim wX wY -> Maybe FileName
(forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Bool)
-> (forall wX wY. Prim wX wY -> Maybe FileName)
-> PrimClassify Prim
forall wX wY. Prim wX wY -> Bool
forall wX wY. Prim wX wY -> Maybe FileName
forall (prim :: * -> * -> *).
(forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Bool)
-> (forall wX wY. prim wX wY -> Maybe FileName)
-> PrimClassify prim
is_filepatch :: Prim wX wY -> Maybe FileName
$cis_filepatch :: forall wX wY. Prim wX wY -> Maybe FileName
primIsSetpref :: Prim wX wY -> Bool
$cprimIsSetpref :: forall wX wY. Prim wX wY -> Bool
primIsBinary :: Prim wX wY -> Bool
$cprimIsBinary :: forall wX wY. Prim wX wY -> Bool
primIsTokReplace :: Prim wX wY -> Bool
$cprimIsTokReplace :: forall wX wY. Prim wX wY -> Bool
primIsHunk :: Prim wX wY -> Bool
$cprimIsHunk :: forall wX wY. Prim wX wY -> Bool
primIsMove :: Prim wX wY -> Bool
$cprimIsMove :: forall wX wY. Prim wX wY -> Bool
primIsRmdir :: Prim wX wY -> Bool
$cprimIsRmdir :: forall wX wY. Prim wX wY -> Bool
primIsAdddir :: Prim wX wY -> Bool
$cprimIsAdddir :: forall wX wY. Prim wX wY -> Bool
primIsRmfile :: Prim wX wY -> Bool
$cprimIsRmfile :: forall wX wY. Prim wX wY -> Bool
primIsAddfile :: Prim wX wY -> Bool
$cprimIsAddfile :: forall wX wY. Prim wX wY -> Bool
PrimClassify
, Prim wX wX
FilePath -> Prim wX wY
FilePath -> Prim wX wY
FilePath -> Prim wX wY
FilePath -> Prim wX wY
FilePath -> Int -> [ByteString] -> [ByteString] -> Prim wX wY
FilePath -> FilePath -> Prim wX wY
FilePath -> FilePath -> FilePath -> Prim wX wY
FilePath -> FilePath -> FilePath -> FilePath -> Prim wX wY
FilePath -> ByteString -> ByteString -> Prim wX wY
FileHunk wX wY -> Prim wX wY
(forall wX wY. FilePath -> Prim wX wY)
-> (forall wX wY. FilePath -> Prim wX wY)
-> (forall wX wY. FilePath -> Prim wX wY)
-> (forall wX wY. FilePath -> Prim wX wY)
-> (forall wX wY. FilePath -> FilePath -> Prim wX wY)
-> (forall wX wY. FilePath -> FilePath -> FilePath -> Prim wX wY)
-> (forall wX wY.
FilePath -> Int -> [ByteString] -> [ByteString] -> Prim wX wY)
-> (forall wX wY.
FilePath -> FilePath -> FilePath -> FilePath -> Prim wX wY)
-> (forall wX wY.
FilePath -> ByteString -> ByteString -> Prim wX wY)
-> (forall wX wY. FileHunk wX wY -> Prim wX wY)
-> (forall wX. Prim wX wX)
-> PrimConstruct Prim
forall wX. Prim wX wX
forall wX wY. FilePath -> Prim wX wY
forall wX wY.
FilePath -> Int -> [ByteString] -> [ByteString] -> Prim wX wY
forall wX wY. FilePath -> FilePath -> Prim wX wY
forall wX wY. FilePath -> FilePath -> FilePath -> Prim wX wY
forall wX wY.
FilePath -> FilePath -> FilePath -> FilePath -> Prim wX wY
forall wX wY. FilePath -> ByteString -> ByteString -> Prim wX wY
forall wX wY. FileHunk wX wY -> Prim wX wY
forall (prim :: * -> * -> *).
(forall wX wY. FilePath -> prim wX wY)
-> (forall wX wY. FilePath -> prim wX wY)
-> (forall wX wY. FilePath -> prim wX wY)
-> (forall wX wY. FilePath -> prim wX wY)
-> (forall wX wY. FilePath -> FilePath -> prim wX wY)
-> (forall wX wY. FilePath -> FilePath -> FilePath -> prim wX wY)
-> (forall wX wY.
FilePath -> Int -> [ByteString] -> [ByteString] -> prim wX wY)
-> (forall wX wY.
FilePath -> FilePath -> FilePath -> FilePath -> prim wX wY)
-> (forall wX wY.
FilePath -> ByteString -> ByteString -> prim wX wY)
-> (forall wX wY. FileHunk wX wY -> prim wX wY)
-> (forall wX. prim wX wX)
-> PrimConstruct prim
anIdentity :: Prim wX wX
$canIdentity :: forall wX. Prim wX wX
primFromHunk :: FileHunk wX wY -> Prim wX wY
$cprimFromHunk :: forall wX wY. FileHunk wX wY -> Prim wX wY
binary :: FilePath -> ByteString -> ByteString -> Prim wX wY
$cbinary :: forall wX wY. FilePath -> ByteString -> ByteString -> Prim wX wY
tokreplace :: FilePath -> FilePath -> FilePath -> FilePath -> Prim wX wY
$ctokreplace :: forall wX wY.
FilePath -> FilePath -> FilePath -> FilePath -> Prim wX wY
hunk :: FilePath -> Int -> [ByteString] -> [ByteString] -> Prim wX wY
$chunk :: forall wX wY.
FilePath -> Int -> [ByteString] -> [ByteString] -> Prim wX wY
changepref :: FilePath -> FilePath -> FilePath -> Prim wX wY
$cchangepref :: forall wX wY. FilePath -> FilePath -> FilePath -> Prim wX wY
move :: FilePath -> FilePath -> Prim wX wY
$cmove :: forall wX wY. FilePath -> FilePath -> Prim wX wY
rmdir :: FilePath -> Prim wX wY
$crmdir :: forall wX wY. FilePath -> Prim wX wY
adddir :: FilePath -> Prim wX wY
$cadddir :: forall wX wY. FilePath -> Prim wX wY
rmfile :: FilePath -> Prim wX wY
$crmfile :: forall wX wY. FilePath -> Prim wX wY
addfile :: FilePath -> Prim wX wY
$caddfile :: forall wX wY. FilePath -> Prim wX wY
PrimConstruct
, Prim wX wY -> [SummDetail]
(forall wX wY. Prim wX wY -> [SummDetail]) -> PrimDetails Prim
forall wX wY. Prim wX wY -> [SummDetail]
forall (prim :: * -> * -> *).
(forall wX wY. prim wX wY -> [SummDetail]) -> PrimDetails prim
summarizePrim :: Prim wX wY -> [SummDetail]
$csummarizePrim :: forall wX wY. Prim wX wY -> [SummDetail]
PrimDetails
, Eq2 Prim
Show2 Prim
Invert Prim
PatchInspect Prim
Commute Prim
Apply Prim
IsHunk Prim
RepairToFL Prim
PrimApply Prim
PrimDetails Prim
PrimCanonize Prim
PrimConstruct Prim
PrimClassify Prim
(Apply Prim, Commute Prim, Invert Prim, Eq2 Prim, IsHunk Prim,
PatchInspect Prim, RepairToFL Prim, Show2 Prim, PrimConstruct Prim,
PrimCanonize Prim, PrimClassify Prim, PrimDetails Prim,
PrimApply Prim) =>
PrimPatchCommon Prim
forall (prim :: * -> * -> *).
(Apply prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim,
PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim,
PrimCanonize prim, PrimClassify prim, PrimDetails prim,
PrimApply prim) =>
PrimPatchCommon prim
$cp13PrimPatchCommon :: PrimApply Prim
$cp12PrimPatchCommon :: PrimDetails Prim
$cp11PrimPatchCommon :: PrimClassify Prim
$cp10PrimPatchCommon :: PrimCanonize Prim
$cp9PrimPatchCommon :: PrimConstruct Prim
$cp8PrimPatchCommon :: Show2 Prim
$cp7PrimPatchCommon :: RepairToFL Prim
$cp6PrimPatchCommon :: PatchInspect Prim
$cp5PrimPatchCommon :: IsHunk Prim
$cp4PrimPatchCommon :: Eq2 Prim
$cp3PrimPatchCommon :: Invert Prim
$cp2PrimPatchCommon :: Commute Prim
$cp1PrimPatchCommon :: Apply Prim
PrimPatchCommon
)
instance PrimPatch Prim
instance Show (Prim wX wY) where
showsPrec :: Int -> Prim wX wY -> ShowS
showsPrec d :: Int
d (Prim p :: Prim wX wY
p) =
Bool -> ShowS -> ShowS
showParen (Int
d Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
appPrec) (ShowS -> ShowS) -> ShowS -> ShowS
forall a b. (a -> b) -> a -> b
$ FilePath -> ShowS
showString "Prim " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Prim wX wY -> ShowS
forall (a :: * -> * -> *) wX wY. Show2 a => Int -> a wX wY -> ShowS
showsPrec2 (Int
appPrec Int -> Int -> Int
forall a. Num a => a -> a -> a
+ 1) Prim wX wY
p
instance Show1 (Prim wX) where
showDict1 :: ShowDict (Prim wX wX)
showDict1 = ShowDict (Prim wX wX)
forall a. Show a => ShowDict a
ShowDictClass
instance Show2 Prim where
showDict2 :: ShowDict (Prim wX wY)
showDict2 = ShowDict (Prim wX wY)
forall a. Show a => ShowDict a
ShowDictClass
instance PrimPatchBase Prim where
type PrimOf Prim = Prim
instance FromPrim Prim where
fromPrim :: PrimOf Prim wX wY -> Prim wX wY
fromPrim = PrimOf Prim wX wY -> Prim wX wY
forall a. a -> a
id
instance ToFromPrim Prim where
toPrim :: Prim wX wY -> Maybe (PrimOf Prim wX wY)
toPrim = Prim wX wY -> Maybe (PrimOf Prim wX wY)
forall a. a -> Maybe a
Just
instance ReadPatch Prim where
readPatch' :: m (Sealed (Prim wX))
readPatch' = (Sealed (Prim wX) -> Sealed (Prim wX))
-> m (Sealed (Prim wX)) -> m (Sealed (Prim wX))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((forall wX. Prim wX wX -> Prim wX wX)
-> Sealed (Prim wX) -> Sealed (Prim wX)
forall (a :: * -> *) (b :: * -> *).
(forall wX. a wX -> b wX) -> Sealed a -> Sealed b
mapSeal forall wX. Prim wX wX -> Prim wX wX
forall x y. Prim x y -> Prim x y
Prim) (FileNameFormat -> m (Sealed (Prim wX))
forall (prim :: * -> * -> *) (m :: * -> *) wX.
(PrimRead prim, ParserM m) =>
FileNameFormat -> m (Sealed (prim wX))
readPrim FileNameFormat
NewFormat)
fileNameFormat :: ShowPatchFor -> FileNameFormat
fileNameFormat :: ShowPatchFor -> FileNameFormat
fileNameFormat ForDisplay = FileNameFormat
UserFormat
fileNameFormat ForStorage = FileNameFormat
NewFormat
instance ShowPatchBasic Prim where
showPatch :: ShowPatchFor -> Prim wX wY -> Doc
showPatch f :: ShowPatchFor
f = FileNameFormat -> Prim wX wY -> Doc
forall (prim :: * -> * -> *) wA wB.
PrimShow prim =>
FileNameFormat -> prim wA wB -> Doc
showPrim (ShowPatchFor -> FileNameFormat
fileNameFormat ShowPatchFor
f) (Prim wX wY -> Doc)
-> (Prim wX wY -> Prim wX wY) -> Prim wX wY -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Prim wX wY -> Prim wX wY
forall x y. Prim x y -> Prim x y
unPrim
instance ShowContextPatch Prim where
showContextPatch :: ShowPatchFor -> Prim wX wY -> m Doc
showContextPatch f :: ShowPatchFor
f = FileNameFormat -> Prim wX wY -> m Doc
forall (prim :: * -> * -> *) (m :: * -> *) wA wB.
(PrimShow prim, ApplyMonad (ApplyState prim) m) =>
FileNameFormat -> prim wA wB -> m Doc
showPrimCtx (ShowPatchFor -> FileNameFormat
fileNameFormat ShowPatchFor
f) (Prim wX wY -> m Doc)
-> (Prim wX wY -> Prim wX wY) -> Prim wX wY -> m Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Prim wX wY -> Prim wX wY
forall x y. Prim x y -> Prim x y
unPrim
instance ShowPatch Prim where
summary :: Prim wX wY -> Doc
summary = Prim wX wY -> Doc
forall (prim :: * -> * -> *) wX wY.
PrimDetails prim =>
prim wX wY -> Doc
plainSummaryPrim (Prim wX wY -> Doc)
-> (Prim wX wY -> Prim wX wY) -> Prim wX wY -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Prim wX wY -> Prim wX wY
forall x y. Prim x y -> Prim x y
unPrim
summaryFL :: FL Prim wX wY -> Doc
summaryFL = Bool -> FL Prim wX wY -> Doc
forall (prim :: * -> * -> *) wX wY.
PrimDetails prim =>
Bool -> FL prim wX wY -> Doc
plainSummaryPrims Bool
False
thing :: Prim wX wY -> FilePath
thing _ = "change"
instance PatchListFormat Prim where
patchListFormat :: ListFormat Prim
patchListFormat = ListFormat Prim
forall (p :: * -> * -> *). ListFormat p
ListFormatV2
instance Apply Prim where
type ApplyState Prim = ApplyState Base.Prim
apply :: Prim wX wY -> m ()
apply = Prim wX wY -> m ()
forall (p :: * -> * -> *) (m :: * -> *) wX wY.
(Apply p, ApplyMonad (ApplyState p) m) =>
p wX wY -> m ()
apply (Prim wX wY -> m ())
-> (Prim wX wY -> Prim wX wY) -> Prim wX wY -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Prim wX wY -> Prim wX wY
forall x y. Prim x y -> Prim x y
unPrim
instance RepairToFL Prim where
applyAndTryToFixFL :: Prim wX wY -> m (Maybe (FilePath, FL Prim wX wY))
applyAndTryToFixFL = (Maybe (FilePath, FL Prim wX wY)
-> Maybe (FilePath, FL Prim wX wY))
-> m (Maybe (FilePath, FL Prim wX wY))
-> m (Maybe (FilePath, FL Prim wX wY))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Maybe (FilePath, FL Prim wX wY) -> Maybe (FilePath, FL Prim wX wY)
forall a b. Coercible a b => a -> b
coerce (m (Maybe (FilePath, FL Prim wX wY))
-> m (Maybe (FilePath, FL Prim wX wY)))
-> (Prim wX wY -> m (Maybe (FilePath, FL Prim wX wY)))
-> Prim wX wY
-> m (Maybe (FilePath, FL Prim wX wY))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Prim wX wY -> m (Maybe (FilePath, FL Prim wX wY))
forall (p :: * -> * -> *) (m :: * -> *) wX wY.
(RepairToFL p, ApplyMonad (ApplyState p) m) =>
p wX wY -> m (Maybe (FilePath, FL p wX wY))
applyAndTryToFixFL (Prim wX wY -> m (Maybe (FilePath, FL Prim wX wY)))
-> (Prim wX wY -> Prim wX wY)
-> Prim wX wY
-> m (Maybe (FilePath, FL Prim wX wY))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Prim wX wY -> Prim wX wY
forall x y. Prim x y -> Prim x y
unPrim