Safe HaskellNone




type Library = Seq LibraryItemSource

A Library is just a rebranded Seq

type ItemId = IntSource

data LibraryItem Source

An item in the library




itemId :: !ItemId
itemName :: !Text256
itemDescription :: !(Maybe Text4096)
itemDateCreated :: !UTCTime
itemDateModified :: !UTCTime
itemParent :: !ItemId
itemType :: !(Either Directory UUIRI)

data Error Source

Some errors that might occur


Eq Error 
Ord Error 
Show Error 
Typeable Error 
SafeCopy Error 

empty :: UTCTime -> LibrarySource

move :: Library -> ItemId -> ItemId -> UTCTime -> Either Error LibrarySource

copy :: Library -> ItemId -> ItemId -> UTCTime -> Either Error LibrarySource

rename :: Library -> ItemId -> Text -> UTCTime -> LibrarySource

Changes the name of an item

describe :: Library -> ItemId -> Text -> UTCTime -> LibrarySource

Sets the description of an item

touch :: Library -> ItemId -> UTCTime -> LibrarySource

Sets the modified date of an item to the one supplied in arg t

new :: Text -> Maybe Text -> UTCTime -> ItemId -> Maybe UUIRI -> Library -> Either Error LibrarySource

Create a new item in the library If createing a directory then uuiri must be Nothing

unsafeGetItem :: ItemId -> Library -> LibraryItemSource

No bounds checking and doesn't filter deleted items returns an exception error when the item is not found

getItem :: ItemId -> Library -> Either Error LibraryItemSource

Does bounds checking and also checks if the item was not deleted

getItemMaybe :: ItemId -> Maybe Library -> Either Error LibraryItemSource

getItem tailored to return an Error if the 2nd argument is Nothing