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. withAdjusted :: (MonadIO m, MonadMask m) => Store ctx -> (ctx -> ctx) -> (ctx -> m a) -> m a

    context Context

    Convenience function to adjust the context then supply the adjusted context to the inner action. This function is equivalent to calling adjust and then immediately calling mine in the inner action of adjust, e.g.:

    doStuff :: Store Thing -> (Thing -> Thing) -> IO ()
    doStuff store f = do
    adjust store f do
    adjustedThing <- mine store
    ...
    
    Throws a NotFoundException when the calling thread has no registered context.

  2. adjust :: (MonadIO m, MonadMask m, ?contextStore :: Store ctx) => (ctx -> ctx) -> m a -> m a

    context Context.Implicit

    Adjust the calling thread's context in the implicit Store for the duration of the specified action. Throws a NotFoundException when the calling thread has no registered context.

  3. withAdjusted :: (MonadIO m, MonadMask m, ?contextStore :: Store ctx) => (ctx -> ctx) -> (ctx -> m a) -> m a

    context Context.Implicit

    Convenience function to adjust the context then supply the adjusted context to the inner action. This function is equivalent to calling adjust and then immediately calling mine in the inner action of adjust, e.g.:

    doStuff :: Store Thing -> (Thing -> Thing) -> IO ()
    doStuff store f = do
    adjust store f do
    adjustedThing <- mine store
    ...
    
    Throws a NotFoundException when the calling thread has no registered context.

  4. 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

    esqueleto Database.Esqueleto

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

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

    esqueleto Database.Esqueleto

    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.

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

    esqueleto Database.Esqueleto

    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 |
    +----+------+-----+
    

  7. 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

    esqueleto Database.Esqueleto.Experimental

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

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

    esqueleto Database.Esqueleto.Experimental

    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.

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

    esqueleto Database.Esqueleto.Experimental

    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 |
    +----+------+-----+
    

  10. 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

    esqueleto Database.Esqueleto.Legacy

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

Page 53 of many | Previous | Next