{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE UndecidableInstances #-}
module Test.StateMachine.Diffing (CanDiff(..), ediff) where
import Data.Proxy
(Proxy(..))
import qualified Text.PrettyPrint.ANSI.Leijen as WL
class CanDiff x where
type AnExpr x
type ADiff x
toDiff :: x -> AnExpr x
exprDiff :: Proxy x -> AnExpr x -> AnExpr x -> ADiff x
diffToDocCompact :: Proxy x -> ADiff x -> WL.Doc
diffToDoc :: Proxy x -> ADiff x -> WL.Doc
exprToDoc :: Proxy x -> AnExpr x -> WL.Doc
ediff :: forall x. CanDiff x => x -> x -> ADiff x
ediff :: forall x. CanDiff x => x -> x -> ADiff x
ediff x
x x
y = Proxy x -> AnExpr x -> AnExpr x -> ADiff x
forall x. CanDiff x => Proxy x -> AnExpr x -> AnExpr x -> ADiff x
exprDiff (forall t. Proxy t
forall {k} (t :: k). Proxy t
Proxy @x) (x -> AnExpr x
forall x. CanDiff x => x -> AnExpr x
toDiff x
x) (x -> AnExpr x
forall x. CanDiff x => x -> AnExpr x
toDiff x
y)