| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Darcs.Patch.Object
Synopsis
- type family ObjectIdOf (state :: (* -> *) -> *)
- class Eq oid => ObjectId oid where
- formatObjectId :: FileNameFormat -> oid -> Doc
- formatFileName :: FileNameFormat -> AnchoredPath -> Doc
- ap2fp :: AnchoredPath -> FilePath
Documentation
type family ObjectIdOf (state :: (* -> *) -> *) Source #
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
| type ObjectIdOf ObjectMap Source # | |
Defined in Darcs.Patch.Prim.FileUUID.ObjectMap | |
| type ObjectIdOf Tree Source # | |
Defined in Darcs.Patch.Object | |
class Eq oid => ObjectId oid where Source #
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 Source #
Instances
| ObjectId AnchoredPath Source # | |
Defined in Darcs.Patch.Object Methods formatObjectId :: FileNameFormat -> AnchoredPath -> Doc Source # | |
formatFileName :: FileNameFormat -> AnchoredPath -> Doc Source #
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.
ap2fp :: AnchoredPath -> FilePath Source #