Hoogle Search

Within LTS Haskell 24.28 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. getJustEntity :: forall record backend (m :: Type -> Type) . (PersistEntityBackend record ~ BaseBackend backend, MonadIO m, PersistEntity record, PersistStoreRead backend) => Key record -> ReaderT backend m (Entity record)

    persistent Database.Persist.Class

    Same as getJust, but returns an Entity instead of just the record.

    Example usage

    With schema-1 and dataset-1,
    getJustEntitySpj :: MonadIO m => ReaderT SqlBackend m (Entity User)
    getJustEntitySpj = getJustEntity spjId
    
    spjEnt <- getJustEntitySpj
    
    The above query when applied on dataset-1, will get this entity:
    +----+------+-----+
    | id | name | age |
    +----+------+-----+
    |  1 | SPJ  |  40 |
    +----+------+-----+
    

  2. belongsToJust :: forall ent1 ent2 backend (m :: Type -> Type) . (PersistStoreRead backend, PersistEntity ent1, PersistRecordBackend ent2 backend, MonadIO m) => (ent1 -> Key ent2) -> ent1 -> ReaderT backend m ent2

    persistent Database.Persist.Class.PersistStore

    Same as belongsTo, but uses getJust and therefore is similarly unsafe.

  3. getJust :: forall record backend (m :: Type -> Type) . (PersistStoreRead backend, PersistRecordBackend record backend, MonadIO m) => Key record -> ReaderT backend m record

    persistent Database.Persist.Class.PersistStore

    Same as get, but for a non-null (not Maybe) foreign key. Unsafe unless your database is enforcing that the foreign key is valid.

    Example usage

    With schema-1 and dataset-1,
    getJustSpj :: MonadIO m => ReaderT SqlBackend m User
    getJustSpj = getJust spjId
    
    spj <- getJust spjId
    
    The above query when applied on dataset-1, will get this record:
    +----+------+-----+
    | id | name | age |
    +----+------+-----+
    |  1 | SPJ  |  40 |
    +----+------+-----+
    
    getJustUnknown :: MonadIO m => ReaderT SqlBackend m User
    getJustUnknown = getJust unknownId
    
    mrx <- getJustUnknown This just throws an error.

  4. getJustEntity :: forall record backend (m :: Type -> Type) . (PersistEntityBackend record ~ BaseBackend backend, MonadIO m, PersistEntity record, PersistStoreRead backend) => Key record -> ReaderT backend m (Entity record)

    persistent Database.Persist.Class.PersistStore

    Same as getJust, but returns an Entity instead of just the record.

    Example usage

    With schema-1 and dataset-1,
    getJustEntitySpj :: MonadIO m => ReaderT SqlBackend m (Entity User)
    getJustEntitySpj = getJustEntity spjId
    
    spjEnt <- getJustEntitySpj
    
    The above query when applied on dataset-1, will get this entity:
    +----+------+-----+
    | id | name | age |
    +----+------+-----+
    |  1 | SPJ  |  40 |
    +----+------+-----+
    

  5. catchJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a

    lifted-base Control.Exception.Lifted

    Generalized version of catchJust. Note, when the given computation throws an exception any monadic side effects in m will be discarded.

  6. handleJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> (b -> m a) -> m a -> m a

    lifted-base Control.Exception.Lifted

    Generalized version of handleJust. Note, when the given computation throws an exception any monadic side effects in m will be discarded.

  7. tryJust :: (MonadBaseControl IO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)

    lifted-base Control.Exception.Lifted

    Generalized version of tryJust. Note, when the given computation throws an exception any monadic side effects in m will be discarded.

  8. catchGErrorJust :: GErrorClass err => err -> IO a -> (GErrorMessage -> IO a) -> IO a

    haskell-gi-base Data.GI.Base.GError

    This will catch just a specific GError exception. If you need to catch a range of related errors, catchGErrorJustDomain is probably more appropriate. Example:

    do image <- catchGErrorJust PixbufErrorCorruptImage
    loadImage
    (\errorMessage -> do log errorMessage
    return mssingImagePlaceholder)
    

  9. catchGErrorJustDomain :: GErrorClass err => IO a -> (err -> GErrorMessage -> IO a) -> IO a

    haskell-gi-base Data.GI.Base.GError

    Catch all GErrors from a particular error domain. The handler function should just deal with one error enumeration type. If you need to catch errors from more than one error domain, use this function twice with an appropriate handler functions for each.

    catchGErrorJustDomain
    loadImage
    (\err message -> case err of
    PixbufErrorCorruptImage -> ...
    PixbufErrorInsufficientMemory -> ...
    PixbufErrorUnknownType -> ...
    _ -> ...)
    

  10. handleGErrorJust :: GErrorClass err => err -> (GErrorMessage -> IO a) -> IO a -> IO a

    haskell-gi-base Data.GI.Base.GError

    A verson of handleGErrorJust with the arguments swapped around.

Page 38 of many | Previous | Next