filestore-0.6.4: Interface for versioning file stores.
CopyrightCopyright (C) 2009 John MacFarlane
LicenseBSD 3
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
PortabilityGHC 6.10 required
Safe HaskellSafe
LanguageHaskell98

Data.FileStore.Types

Description

Type definitions for Data.FileStore.

Synopsis

Documentation

type RevisionId = String Source #

data Resource Source #

Constructors

FSFile FilePath 
FSDirectory FilePath 

Instances

Instances details
Eq Resource Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: Resource -> Resource -> Bool

(/=) :: Resource -> Resource -> Bool

Ord Resource Source # 
Instance details

Defined in Data.FileStore.Types

Methods

compare :: Resource -> Resource -> Ordering

(<) :: Resource -> Resource -> Bool

(<=) :: Resource -> Resource -> Bool

(>) :: Resource -> Resource -> Bool

(>=) :: Resource -> Resource -> Bool

max :: Resource -> Resource -> Resource

min :: Resource -> Resource -> Resource

Read Resource Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS Resource

readList :: ReadS [Resource]

readPrec :: ReadPrec Resource

readListPrec :: ReadPrec [Resource]

Show Resource Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> Resource -> ShowS

show :: Resource -> String

showList :: [Resource] -> ShowS

data Author Source #

Constructors

Author 

Fields

Instances

Instances details
Eq Author Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: Author -> Author -> Bool

(/=) :: Author -> Author -> Bool

Read Author Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS Author

readList :: ReadS [Author]

readPrec :: ReadPrec Author

readListPrec :: ReadPrec [Author]

Show Author Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> Author -> ShowS

show :: Author -> String

showList :: [Author] -> ShowS

data Change Source #

Constructors

Added FilePath 
Deleted FilePath 
Modified FilePath 

Instances

Instances details
Eq Change Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: Change -> Change -> Bool

(/=) :: Change -> Change -> Bool

Read Change Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS Change

readList :: ReadS [Change]

readPrec :: ReadPrec Change

readListPrec :: ReadPrec [Change]

Show Change Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> Change -> ShowS

show :: Change -> String

showList :: [Change] -> ShowS

type Description = String Source #

data Revision Source #

Instances

Instances details
Eq Revision Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: Revision -> Revision -> Bool

(/=) :: Revision -> Revision -> Bool

Read Revision Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS Revision

readList :: ReadS [Revision]

readPrec :: ReadPrec Revision

readListPrec :: ReadPrec [Revision]

Show Revision Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> Revision -> ShowS

show :: Revision -> String

showList :: [Revision] -> ShowS

class Contents a where Source #

Methods

fromByteString :: ByteString -> a Source #

toByteString :: a -> ByteString Source #

Instances

Instances details
Contents String Source # 
Instance details

Defined in Data.FileStore.Types

Methods

fromByteString :: ByteString -> String Source #

toByteString :: String -> ByteString Source #

Contents ByteString Source # 
Instance details

Defined in Data.FileStore.Types

Methods

fromByteString :: ByteString -> ByteString Source #

toByteString :: ByteString -> ByteString Source #

data TimeRange Source #

Constructors

TimeRange 

Fields

Instances

Instances details
Eq TimeRange Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: TimeRange -> TimeRange -> Bool

(/=) :: TimeRange -> TimeRange -> Bool

Read TimeRange Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS TimeRange

readList :: ReadS [TimeRange]

readPrec :: ReadPrec TimeRange

readListPrec :: ReadPrec [TimeRange]

Show TimeRange Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> TimeRange -> ShowS

show :: TimeRange -> String

showList :: [TimeRange] -> ShowS

data MergeInfo Source #

Constructors

MergeInfo 

Fields

Instances

Instances details
Eq MergeInfo Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: MergeInfo -> MergeInfo -> Bool

(/=) :: MergeInfo -> MergeInfo -> Bool

Read MergeInfo Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS MergeInfo

readList :: ReadS [MergeInfo]

readPrec :: ReadPrec MergeInfo

readListPrec :: ReadPrec [MergeInfo]

Show MergeInfo Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> MergeInfo -> ShowS

show :: MergeInfo -> String

showList :: [MergeInfo] -> ShowS

data FileStoreError Source #

Constructors

RepositoryExists

Tried to initialize a repo that exists

ResourceExists

Tried to create a resource that exists

NotFound

Requested resource was not found

IllegalResourceName

The specified resource name is illegal

Unchanged

The resource was not modified, because the contents were unchanged

UnsupportedOperation 
NoMaxCount

The darcs version used does not support --max-count

UnknownError String 

Instances

Instances details
Eq FileStoreError Source # 
Instance details

Defined in Data.FileStore.Types

Read FileStoreError Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS FileStoreError

readList :: ReadS [FileStoreError]

readPrec :: ReadPrec FileStoreError

readListPrec :: ReadPrec [FileStoreError]

Show FileStoreError Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> FileStoreError -> ShowS

show :: FileStoreError -> String

showList :: [FileStoreError] -> ShowS

Exception FileStoreError Source # 
Instance details

Defined in Data.FileStore.Types

Methods

toException :: FileStoreError -> SomeException

fromException :: SomeException -> Maybe FileStoreError

displayException :: FileStoreError -> String

data SearchMatch Source #

Constructors

SearchMatch 

Fields

Instances

Instances details
Eq SearchMatch Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: SearchMatch -> SearchMatch -> Bool

(/=) :: SearchMatch -> SearchMatch -> Bool

Read SearchMatch Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS SearchMatch

readList :: ReadS [SearchMatch]

readPrec :: ReadPrec SearchMatch

readListPrec :: ReadPrec [SearchMatch]

Show SearchMatch Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> SearchMatch -> ShowS

show :: SearchMatch -> String

showList :: [SearchMatch] -> ShowS

data SearchQuery Source #

Constructors

SearchQuery 

Fields

Instances

Instances details
Eq SearchQuery Source # 
Instance details

Defined in Data.FileStore.Types

Methods

(==) :: SearchQuery -> SearchQuery -> Bool

(/=) :: SearchQuery -> SearchQuery -> Bool

Read SearchQuery Source # 
Instance details

Defined in Data.FileStore.Types

Methods

readsPrec :: Int -> ReadS SearchQuery

readList :: ReadS [SearchQuery]

readPrec :: ReadPrec SearchQuery

readListPrec :: ReadPrec [SearchQuery]

Show SearchQuery Source # 
Instance details

Defined in Data.FileStore.Types

Methods

showsPrec :: Int -> SearchQuery -> ShowS

show :: SearchQuery -> String

showList :: [SearchQuery] -> ShowS

data UTCTime #

Instances

Instances details
Eq UTCTime 
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

(==) :: UTCTime -> UTCTime -> Bool

(/=) :: UTCTime -> UTCTime -> Bool

Data UTCTime 
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UTCTime -> c UTCTime

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCTime

toConstr :: UTCTime -> Constr

dataTypeOf :: UTCTime -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UTCTime)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime)

gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r

gmapQ :: (forall d. Data d => d -> u) -> UTCTime -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCTime -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime

Ord UTCTime 
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

compare :: UTCTime -> UTCTime -> Ordering

(<) :: UTCTime -> UTCTime -> Bool

(<=) :: UTCTime -> UTCTime -> Bool

(>) :: UTCTime -> UTCTime -> Bool

(>=) :: UTCTime -> UTCTime -> Bool

max :: UTCTime -> UTCTime -> UTCTime

min :: UTCTime -> UTCTime -> UTCTime

NFData UTCTime 
Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

rnf :: UTCTime -> ()

data FileStore Source #

A versioning filestore, which can be implemented using the file system, a database, or revision-control software.

Constructors

FileStore 

Fields

  • initialize :: IO ()

    Initialize a new filestore.

  • save :: forall a. Contents a => FilePath -> Author -> Description -> a -> IO ()

    Save contents in the filestore.

  • retrieve :: forall a. Contents a => FilePath -> Maybe RevisionId -> IO a

    Retrieve the contents of the named resource.

  • delete :: FilePath -> Author -> Description -> IO ()

    Delete a named resource, providing author and log message.

  • rename :: FilePath -> FilePath -> Author -> Description -> IO ()

    Rename a resource, providing author and log message.

  • history :: [FilePath] -> TimeRange -> Maybe Int -> IO [Revision]

    Get history for a list of named resources in a (possibly openended) time range. If the list is empty, history for all resources will be returned. If the TimeRange is 2 Nothings, history for all dates will be returned.

  • latest :: FilePath -> IO RevisionId

    Return the revision ID of the latest change for a resource. Raises NotFound if the resource is not found.

  • revision :: RevisionId -> IO Revision

    Return information about a revision, given the ID. Raises NotFound if there is no such revision.

  • index :: IO [FilePath]

    Return a list of resources in the filestore.

  • directory :: FilePath -> IO [Resource]

    Return a list of resources in a directory of the filestore.

  • idsMatch :: RevisionId -> RevisionId -> Bool

    True if the revision IDs match, in the sense that the can be treated as specifying the same revision.

  • search :: SearchQuery -> IO [SearchMatch]

    Search the filestore for patterns.