darcs-2.12.5: a distributed, interactive, smart revision control system

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Witnesses.Eq

Synopsis

- data EqCheck wA wB where
  - IsEq :: EqCheck wA wA
  - NotEq :: EqCheck wA wB
- class MyEq p where
- isIsEq :: EqCheck wA wB -> Bool

# Documentation

data EqCheck wA wB where #

`EqCheck` is used to pass around evidence (or lack thereof) of two witness types being equal.

Constructors

IsEq :: EqCheck wA wA |
NotEq :: EqCheck wA wB |

Instances

Eq (EqCheck wA wB) # |
Methods (==) :: EqCheck wA wB -> EqCheck wA wB -> Bool # (/=) :: EqCheck wA wB -> EqCheck wA wB -> Bool #
Show (EqCheck wA wB) # |
Methods showsPrec :: Int -> EqCheck wA wB -> ShowS # show :: EqCheck wA wB -> String # showList :: [EqCheck wA wB] -> ShowS #

class MyEq p where #

An witness aware equality class. A minimal definition defines any one of `unsafeCompare`, `=\/=` and `=/\=`.

Methods

unsafeCompare :: p wA wB -> p wC wD -> Bool #

It is unsafe to define a class instance via this method, because if it returns True then the default implementations of `=\/=` and `=/\=` will coerce the equality of two witnesses.

Calling this method is safe, although `=\/=` or `=/\=` would be better choices as it is not usually meaningul to compare two patches that don't share either a starting or an ending context

(=\/=) :: p wA wB -> p wA wC -> EqCheck wB wC infix 4 #

Compare two things with the same starting witness. If the things compare equal, evidence of the ending witnesses being equal will be returned.

(=/\=) :: p wA wC -> p wB wC -> EqCheck wA wB infix 4 #

Compare two things with the same ending witness. If the things compare equal, evidence of the starting witnesses being equal will be returned.

Instances

MyEq Prim # |
Methods unsafeCompare :: 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 #
MyEq Hunk # |
Methods unsafeCompare :: Hunk wA wB -> Hunk wC wD -> Bool # (=\/=) :: Hunk wA wB -> Hunk wA wC -> EqCheck wB wC # (=/\=) :: Hunk wA wC -> Hunk wB wC -> EqCheck wA wB #
MyEq DirPatchType # |
Methods unsafeCompare :: DirPatchType wA wB -> DirPatchType wC wD -> Bool # (=\/=) :: DirPatchType wA wB -> DirPatchType wA wC -> EqCheck wB wC # (=/\=) :: DirPatchType wA wC -> DirPatchType wB wC -> EqCheck wA wB #
MyEq FilePatchType # |
Methods unsafeCompare :: FilePatchType wA wB -> FilePatchType wC wD -> Bool # (=\/=) :: FilePatchType wA wB -> FilePatchType wA wC -> EqCheck wB wC # (=/\=) :: FilePatchType wA wC -> FilePatchType wB wC -> EqCheck wA wB #
MyEq Prim # |
Methods unsafeCompare :: 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 #
MyEq DummyPatch # |
Methods unsafeCompare :: DummyPatch wA wB -> DummyPatch wC wD -> Bool # (=\/=) :: DummyPatch wA wB -> DummyPatch wA wC -> EqCheck wB wC # (=/\=) :: DummyPatch wA wC -> DummyPatch wB wC -> EqCheck wA wB #
MyEq WPatchInfo # |
Methods unsafeCompare :: WPatchInfo wA wB -> WPatchInfo wC wD -> Bool # (=\/=) :: WPatchInfo wA wB -> WPatchInfo wA wC -> EqCheck wB wC # (=/\=) :: WPatchInfo wA wC -> WPatchInfo wB wC -> EqCheck wA wB #
(Commute p, MyEq p) => MyEq (Named p) # |
Methods unsafeCompare :: Named p wA wB -> Named p wC wD -> Bool # (=\/=) :: Named p wA wB -> Named p wA wC -> EqCheck wB wC # (=/\=) :: Named p wA wC -> Named p wB wC -> EqCheck wA wB #
MyEq (RebaseName p) # |
Methods unsafeCompare :: RebaseName p wA wB -> RebaseName p wC wD -> Bool # (=\/=) :: RebaseName p wA wB -> RebaseName p wA wC -> EqCheck wB wC # (=/\=) :: RebaseName p wA wC -> RebaseName p wB wC -> EqCheck wA wB #
MyEq (PrimOf p) => MyEq (RebaseFixup p) # |
Methods unsafeCompare :: RebaseFixup p wA wB -> RebaseFixup p wC wD -> Bool # (=\/=) :: RebaseFixup p wA wB -> RebaseFixup p wA wC -> EqCheck wB wC # (=/\=) :: RebaseFixup p wA wC -> RebaseFixup p wB wC -> EqCheck wA wB #
PrimPatch prim => MyEq (RepoPatchV2 prim) # |
Methods unsafeCompare :: RepoPatchV2 prim wA wB -> RepoPatchV2 prim wC wD -> Bool # (=\/=) :: RepoPatchV2 prim wA wB -> RepoPatchV2 prim wA wC -> EqCheck wB wC # (=/\=) :: RepoPatchV2 prim wA wC -> RepoPatchV2 prim wB wC -> EqCheck wA wB #
MyEq p => MyEq (LabelledPatch p) # |
Methods unsafeCompare :: LabelledPatch p wA wB -> LabelledPatch p wC wD -> Bool # (=\/=) :: LabelledPatch p wA wB -> LabelledPatch p wA wC -> EqCheck wB wC # (=/\=) :: LabelledPatch p wA wC -> LabelledPatch p wB wC -> EqCheck wA wB #
(PrimPatchBase p, Commute p, MyEq p) => MyEq (RebaseSelect p) # |
Methods unsafeCompare :: RebaseSelect p wA wB -> RebaseSelect p wC wD -> Bool # (=\/=) :: RebaseSelect p wA wB -> RebaseSelect p wA wC -> EqCheck wB wC # (=/\=) :: RebaseSelect p wA wC -> RebaseSelect p wB wC -> EqCheck wA wB #
(MyEq a, MyEq b) => MyEq ((:>) a b) # |
Methods unsafeCompare :: (a :> b) wA wB -> (a :> b) wC wD -> Bool # (=\/=) :: (a :> b) wA wB -> (a :> b) wA wC -> EqCheck wB wC # (=/\=) :: (a :> b) wA wC -> (a :> b) wB wC -> EqCheck wA wB #
MyEq (PatchInfoAnd rt p) # |
Methods unsafeCompare :: PatchInfoAnd rt p wA wB -> PatchInfoAnd rt p wC wD -> Bool # (=\/=) :: PatchInfoAnd rt p wA wB -> PatchInfoAnd rt p wA wC -> EqCheck wB wC # (=/\=) :: PatchInfoAnd rt p wA wC -> PatchInfoAnd rt p wB wC -> EqCheck wA wB #

isIsEq :: EqCheck wA wB -> Bool #