{-# 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 :: forall (m :: * -> *) wX wY.
ApplyMonad (ApplyState (RepoPatchV1 prim)) m =>
ShowPatchFor -> RepoPatchV1 prim wX wY -> m Doc
showContextPatch ShowPatchFor
f (PP prim wX wY
p) = 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 = forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ 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 :: forall wX wY. RepoPatchV1 prim wX wY -> Doc
summary = forall (e :: * -> * -> *) wX wY.
(Summary e, PrimDetails (PrimOf e)) =>
e wX wY -> Doc
plainSummary
    summaryFL :: forall wX wY. FL (RepoPatchV1 prim) wX wY -> Doc
summaryFL = forall (e :: * -> * -> *) wX wY.
(Summary e, PrimDetails (PrimOf e)) =>
FL e wX wY -> Doc
plainSummaryFL
    thing :: forall wX wY. RepoPatchV1 prim wX wY -> String
thing RepoPatchV1 prim wX wY
_ = String
"change"