Safe Haskell | None |
---|
- type Library = Seq LibraryItem
- type ItemId = Int
- data LibraryItem
- = Deleted
- | Item {
- itemId :: !ItemId
- itemName :: !Text256
- itemDescription :: !(Maybe Text4096)
- itemDateCreated :: !UTCTime
- itemDateModified :: !UTCTime
- itemParent :: !ItemId
- itemType :: !(Either Directory UUIRI)
- data Error
- empty :: UTCTime -> Library
- move :: Library -> ItemId -> ItemId -> UTCTime -> Either Error Library
- copy :: Library -> ItemId -> ItemId -> UTCTime -> Either Error Library
- delete :: Library -> ItemId -> Library
- rename :: Library -> ItemId -> Text -> UTCTime -> Library
- describe :: Library -> ItemId -> Text -> UTCTime -> Library
- touch :: Library -> ItemId -> UTCTime -> Library
- new :: Text -> Maybe Text -> UTCTime -> ItemId -> Maybe UUIRI -> Library -> Either Error Library
- unsafeGetItem :: ItemId -> Library -> LibraryItem
- getItem :: ItemId -> Library -> Either Error LibraryItem
- getItemMaybe :: ItemId -> Maybe Library -> Either Error LibraryItem
- showError :: Error -> Text
- isDir :: LibraryItem -> Bool
Documentation
type Library = Seq LibraryItemSource
A Library is just a rebranded Seq
data LibraryItem Source
An item in the library
Deleted | |
Item | |
|
Some errors that might occur
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
isDir :: LibraryItem -> BoolSource