| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hyperion.ObjectId
Synopsis
- newtype ObjectId = ObjectId String
- objectIdToString :: ObjectId -> String
- objectIdToText :: ObjectId -> Text
- getObjectId :: (Binary a, Typeable a, ToJSON a, HasDB env, MonadReader env m, MonadIO m, MonadCatch m) => a -> m ObjectId
Documentation
An identifier for an object, useful for building filenames and database entries.
objectIdToString :: ObjectId -> String Source #
Convert an ObjectId to a String.
objectIdToText :: ObjectId -> Text Source #
Convert an ObjectId to Text.
getObjectId :: (Binary a, Typeable a, ToJSON a, HasDB env, MonadReader env m, MonadIO m, MonadCatch m) => a -> m ObjectId Source #
The ObjectId of an object is the result of hashBase64Safe. The
first time getObjectId is called, it comptues the ObjectId and
stores it in the database before returning it. Subsequent calls
read the value from the database.