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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Witnesses.Eq

Synopsis

- data EqCheck wA wB where
  - IsEq :: forall wA. EqCheck wA wA
  - NotEq :: forall wA wB. EqCheck wA wB
- class Eq2 (p :: Type -> Type -> Type) where
  - unsafeCompare :: p wA wB -> p wC wD -> Bool
  - (=\/=) :: p wA wB -> p wA wC -> EqCheck wB wC
  - (=/\=) :: p wA wC -> p wB wC -> EqCheck wA wB
- 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 :: forall wA. EqCheck wA wA |
NotEq :: forall wA wB. EqCheck wA wB |

#### Instances

Instances details

Show (EqCheck wA wB) # |
Instance details Defined in Darcs.Patch.Witnesses.Eq Methods showsPrec :: Int -> EqCheck wA wB -> ShowS # show :: EqCheck wA wB -> String # showList :: [EqCheck wA wB] -> ShowS #
Eq (EqCheck wA wB) # |
Instance details Defined in Darcs.Patch.Witnesses.Eq Methods (==) :: EqCheck wA wB -> EqCheck wA wB -> Bool # (/=) :: EqCheck wA wB -> EqCheck wA wB -> Bool #

class Eq2 (p :: Type -> Type -> Type) where #

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

Minimal complete definition

unsafeCompare | (=\/=) | (=/\=)

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

Instances details

Eq2 Hunk # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Core 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 #
Eq2 HunkMove # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Core Methods unsafeCompare :: HunkMove wA wB -> HunkMove wC wD -> Bool # (=\/=) :: HunkMove wA wB -> HunkMove wA wC -> EqCheck wB wC # (=/\=) :: HunkMove wA wC -> HunkMove wB wC -> EqCheck wA wB #
Eq2 Prim # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Core 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 #
Eq2 DirPatchType # |
Instance details Defined in Darcs.Patch.Prim.V1.Core 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 #
Eq2 FilePatchType # |
Instance details Defined in Darcs.Patch.Prim.V1.Core 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 #
Eq2 Prim # |
Instance details Defined in Darcs.Patch.Prim.V1.Core 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 #
Eq2 RebaseName # |
Instance details Defined in Darcs.Patch.Rebase.Name Methods unsafeCompare :: RebaseName wA wB -> RebaseName wC wD -> Bool # (=\/=) :: RebaseName wA wB -> RebaseName wA wC -> EqCheck wB wC # (=/\=) :: RebaseName wA wC -> RebaseName wB wC -> EqCheck wA wB #
Eq2 Prim # |
Instance details Defined in Darcs.Patch.V1.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 #
Eq2 Prim # |
Instance details Defined in Darcs.Patch.V2.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 #
Eq2 p => Eq2 (Invertible p) # |
Instance details Defined in Darcs.Patch.Invertible Methods unsafeCompare :: Invertible p wA wB -> Invertible p wC wD -> Bool # (=\/=) :: Invertible p wA wB -> Invertible p wA wC -> EqCheck wB wC # (=/\=) :: Invertible p wA wC -> Invertible p wB wC -> EqCheck wA wB #
(Commute p, Eq2 p) => Eq2 (Named p) # |
Instance details Defined in Darcs.Patch.Named 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 #
Eq2 p => Eq2 (Hopefully p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods unsafeCompare :: Hopefully p wA wB -> Hopefully p wC wD -> Bool # (=\/=) :: Hopefully p wA wB -> Hopefully p wA wC -> EqCheck wB wC # (=/\=) :: Hopefully p wA wC -> Hopefully p wB wC -> EqCheck wA wB #
Eq2 p => Eq2 (PatchInfoAndG p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods unsafeCompare :: PatchInfoAndG p wA wB -> PatchInfoAndG p wC wD -> Bool # (=\/=) :: PatchInfoAndG p wA wB -> PatchInfoAndG p wA wC -> EqCheck wB wC # (=/\=) :: PatchInfoAndG p wA wC -> PatchInfoAndG p wB wC -> EqCheck wA wB #
Eq2 prim => Eq2 (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Commute Methods unsafeCompare :: RepoPatchV1 prim wA wB -> RepoPatchV1 prim wC wD -> Bool # (=\/=) :: RepoPatchV1 prim wA wB -> RepoPatchV1 prim wA wC -> EqCheck wB wC # (=/\=) :: RepoPatchV1 prim wA wC -> RepoPatchV1 prim wB wC -> EqCheck wA wB #
PrimPatch prim => Eq2 (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch 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 #
Eq2 p => Eq2 (FL p) # |
Instance details Defined in Darcs.Patch.Witnesses.Ordered Methods unsafeCompare :: FL p wA wB -> FL p wC wD -> Bool # (=\/=) :: FL p wA wB -> FL p wA wC -> EqCheck wB wC # (=/\=) :: FL p wA wC -> FL p wB wC -> EqCheck wA wB #
Eq2 p => Eq2 (RL p) # |
Instance details Defined in Darcs.Patch.Witnesses.Ordered Methods unsafeCompare :: RL p wA wB -> RL p wC wD -> Bool # (=\/=) :: RL p wA wB -> RL p wA wC -> EqCheck wB wC # (=/\=) :: RL p wA wC -> RL p wB wC -> EqCheck wA wB #
(Eq name, Eq2 p) => Eq2 (PrimWithName name p) # |
Instance details Defined in Darcs.Patch.Prim.WithName Methods unsafeCompare :: PrimWithName name p wA wB -> PrimWithName name p wC wD -> Bool # (=\/=) :: PrimWithName name p wA wB -> PrimWithName name p wA wC -> EqCheck wB wC # (=/\=) :: PrimWithName name p wA wC -> PrimWithName name p wB wC -> EqCheck wA wB #
(SignedId name, Eq2 prim, Commute prim) => Eq2 (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core Methods unsafeCompare :: RepoPatchV3 name prim wA wB -> RepoPatchV3 name prim wC wD -> Bool # (=\/=) :: RepoPatchV3 name prim wA wB -> RepoPatchV3 name prim wA wC -> EqCheck wB wC # (=/\=) :: RepoPatchV3 name prim wA wC -> RepoPatchV3 name prim wB wC -> EqCheck wA wB #
(Eq2 a, Eq2 b) => Eq2 (a :> b) # |
Instance details Defined in Darcs.Patch.Witnesses.Ordered 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 #

isIsEq :: EqCheck wA wB -> Bool #