{-# OPTIONS_GHC -fno-warn-orphans #-}
module Darcs.Patch.V1.Viewing () where

import Darcs.Prelude

import Darcs.Patch.Prim ( PrimPatch )
import Darcs.Patch.Show ( ShowPatch(..), ShowContextPatch(..), showPatch )
import Darcs.Patch.Summary ( plainSummary, plainSummaryFL )

import Darcs.Patch.V1.Apply ()
import Darcs.Patch.V1.Core ( RepoPatchV1(..) )
import Darcs.Patch.V1.Show ()

instance PrimPatch prim => ShowContextPatch (RepoPatchV1 prim) where
    showContextPatch :: ShowPatchFor -> RepoPatchV1 prim wX wY -> m Doc
showContextPatch ShowPatchFor
f (PP prim wX wY
p) = ShowPatchFor -> prim wX wY -> m Doc
forall (p :: * -> * -> *) (m :: * -> *) wX wY.
(ShowContextPatch p, ApplyMonad (ApplyState p) m) =>
ShowPatchFor -> p wX wY -> m Doc
showContextPatch ShowPatchFor
f prim wX wY
p
    showContextPatch ShowPatchFor
f RepoPatchV1 prim wX wY
p = Doc -> m Doc
forall (m :: * -> *) a. Monad m => a -> m a
return (Doc -> m Doc) -> Doc -> m Doc
forall a b. (a -> b) -> a -> b
$ ShowPatchFor -> RepoPatchV1 prim wX wY -> Doc
forall (p :: * -> * -> *) wX wY.
ShowPatchBasic p =>
ShowPatchFor -> p wX wY -> Doc
showPatch ShowPatchFor
f RepoPatchV1 prim wX wY
p

instance PrimPatch prim => ShowPatch (RepoPatchV1 prim) where
    summary :: RepoPatchV1 prim wX wY -> Doc
summary = RepoPatchV1 prim wX wY -> Doc
forall (e :: * -> * -> *) wX wY.
(Summary e, PrimDetails (PrimOf e)) =>
e wX wY -> Doc
plainSummary
    summaryFL :: FL (RepoPatchV1 prim) wX wY -> Doc
summaryFL = FL (RepoPatchV1 prim) wX wY -> Doc
forall (e :: * -> * -> *) wX wY.
(Summary e, PrimDetails (PrimOf e)) =>
FL e wX wY -> Doc
plainSummaryFL
    thing :: RepoPatchV1 prim wX wY -> String
thing RepoPatchV1 prim wX wY
_ = String
"change"