-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple datatype to represent a library with files and folders @package dirfiles @version 0.1.0.9 module Data.Library.IRI data IRI Relative :: !Text -> IRI Absolute :: !Text -> IRI toIRI :: Text -> IRI fromIRI :: IRI -> Text isRelative :: IRI -> Bool isAbsolute :: IRI -> Bool extension :: IRI -> Maybe Text domain :: IRI -> Maybe Text protocol :: IRI -> Maybe Text dirs :: IRI -> [Text] instance SafeCopy IRI instance Show IRI instance FromJSON IRI instance ToJSON IRI module Data.Library.UUIRI newtype UUIRI UUIRI :: (UUID, IRI) -> UUIRI -- | returns the IRI part of the UUIRI iri :: UUIRI -> IRI -- | returns the UUID part of the UUIRI uuid :: UUIRI -> UUID -- | a constructor for UUIRIs toUUIRI :: UUID -> Text -> UUIRI -- | returns the UUIRI tuple with the IRI translated to Text fromUUIRI :: UUIRI -> (UUID, Text) -- | is the IRI part of the UUIRI a relative IRI ? isRelative :: UUIRI -> Bool -- | is the IRI part of the UUIRI an absolute IRI ? isAbsolute :: UUIRI -> Bool -- | returns the IRI extension of a given UUIRI extension :: UUIRI -> Maybe Text -- | returns the IRI domain of a given UUIRI domain :: UUIRI -> Maybe Text -- | returns the IRI protocol of a given UUIRI protocol :: UUIRI -> Maybe Text -- | returns the IRI directories of a given UUIRI dirs :: UUIRI -> [Text] instance SafeCopy UUIRI instance FromJSON UUIRI instance ToJSON UUIRI instance Eq UUIRI module Data.Library -- | A Library is just a rebranded Seq type Library = Seq LibraryItem type ItemId = Int -- | An item in the library data LibraryItem Deleted :: LibraryItem Item :: !ItemId -> !Text256 -> !(Maybe Text4096) -> !UTCTime -> !UTCTime -> !ItemId -> !(Either Directory UUIRI) -> LibraryItem itemId :: LibraryItem -> !ItemId itemName :: LibraryItem -> !Text256 itemDescription :: LibraryItem -> !(Maybe Text4096) itemDateCreated :: LibraryItem -> !UTCTime itemDateModified :: LibraryItem -> !UTCTime itemParent :: LibraryItem -> !ItemId itemType :: LibraryItem -> !(Either Directory UUIRI) -- | Some errors that might occur data Error InvalidDestination :: ItemId -> Error ItemNotFound :: ItemId -> Error InvalidContainer :: Error MovingRoot :: Error empty :: UTCTime -> Library move :: Library -> ItemId -> ItemId -> UTCTime -> Either Error Library copy :: Library -> ItemId -> ItemId -> UTCTime -> Either Error Library delete :: Library -> ItemId -> Library -- | Changes the name of an item rename :: Library -> ItemId -> Text -> UTCTime -> Library -- | Sets the description of an item describe :: Library -> ItemId -> Text -> UTCTime -> Library -- | Sets the modified date of an item to the one supplied in arg t touch :: Library -> ItemId -> UTCTime -> Library -- | Create a new item in the library If createing a directory then uuiri -- must be Nothing new :: Text -> Maybe Text -> UTCTime -> ItemId -> Maybe UUIRI -> Library -> Either Error Library -- | No bounds checking and doesn't filter deleted items returns an -- exception error when the item is not found unsafeGetItem :: ItemId -> Library -> LibraryItem -- | Does bounds checking and also checks if the item was not deleted getItem :: ItemId -> Library -> Either Error LibraryItem -- | getItem tailored to return an Error if the 2nd argument is Nothing getItemMaybe :: ItemId -> Maybe Library -> Either Error LibraryItem showError :: Error -> Text isDir :: LibraryItem -> Bool instance SafeCopy LibraryItem instance SafeCopy Directory instance SafeCopy Error instance Typeable LibraryItem instance Typeable Error instance Eq Error instance Ord Error instance Show Error instance FromJSON LibraryItem instance ToJSON LibraryItem