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

Darcs.Patch.Object

Synopsis

Documentation

type family ObjectIdOf (state :: (Type -> Type) -> Type) #

Given a state type (parameterized over a monad m :: * -> *), this gives us the type of the key with which we can lookup an item (or object) in the state.

Instances

Instances details
type ObjectIdOf ObjectMap # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.ObjectMap

type ObjectIdOf Tree # 
Instance details

Defined in Darcs.Patch.Object

class Eq oid => ObjectId oid where #

We require from such a key (an ObjectId) that it has a canonical way to format itself to a Doc. For historical reasons, this takes a parameter of type FileNameFormat.

Methods

formatObjectId :: FileNameFormat -> oid -> Doc #

Instances

Instances details
ObjectId AnchoredPath # 
Instance details

Defined in Darcs.Patch.Object

formatFileName :: FileNameFormat -> AnchoredPath -> Doc #

Format a AnchoredPath to a Doc according to the given FileNameFormat.

NOTE: This is not only used for display but also to format patch files. This is why we have to do the white space encoding here. See writePatchIfNecessary.

Besides white space encoding, for FileNameFormatV2 we just pack it into a Doc. For FileNameFormatV1 we must emulate the non-standard darcs-1 encoding of file paths: it is an UTF8 encoding of the raw byte stream, interpreted as code points.

See also readFileName.