Hoogle Search

Within LTS Haskell 24.46 (ghc-9.10.3)

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

  1. getAny :: T mode -> T -> IO T

    alsa-seq Sound.ALSA.Sequencer.Client.Info

    Create a new information area filled with data about an arbitrary client. Copy the content of an object to a newly created object.

  2. getAny :: T mode -> T -> T -> IO T

    alsa-seq Sound.ALSA.Sequencer.Port.Info

    No documentation available.

  3. many :: Alternative f => f a -> f [a]

    classy-prelude ClassyPrelude

    Zero or more.

    Examples

    >>> many (putStr "la")
    lalalalalalalalala... * goes on forever *
    
    >>> many Nothing
    Just []
    
    >>> take 5 <$> many (Just 1)
    * hangs forever *
    
    Note that this function can be used with Parsers based on Applicatives. In that case many parser will attempt to parse parser zero or more times until it fails.

  4. MkAnyStore :: forall ctx . Store ctx -> AnyStore

    context Context.Internal

    No documentation available.

  5. ISRManyKeys :: Text -> [PersistValue] -> InsertSqlResult

    esqueleto Database.Esqueleto

    No documentation available.

  6. getMany :: forall record (m :: Type -> Type) . (PersistStoreRead backend, MonadIO m, PersistRecordBackend record backend) => [Key record] -> ReaderT backend m (Map (Key record) record)

    esqueleto Database.Esqueleto

    Get many records by their respective identifiers, if available.

    Example usage

    With schema-1 and dataset-1:
    getUsers :: MonadIO m => ReaderT SqlBackend m (Map (Key User) User)
    getUsers = getMany allkeys
    
    musers <- getUsers
    
    The above query when applied on dataset-1, will get these records:
    +----+-------+-----+
    | id | name  | age |
    +----+-------+-----+
    |  1 | SPJ   |  40 |
    +----+-------+-----+
    |  2 | Simon |  41 |
    +----+-------+-----+
    

  7. insertEntityMany :: forall record (m :: Type -> Type) . (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend) => [Entity record] -> ReaderT backend m ()

    esqueleto Database.Esqueleto

    Same as insertMany_, but takes an Entity instead of just a record. Useful when migrating data from one entity to another and want to preserve ids. The MongoDB, PostgreSQL, SQLite and MySQL backends insert all records in one database query.

    Example usage

    With schema-1 and dataset-1,
    insertUserEntityMany :: MonadIO m => ReaderT SqlBackend m ()
    insertUserEntityMany = insertEntityMany [SnakeEntity, EvaEntity]
    
    The above query when applied on dataset-1, will produce this:
    +-----+------+-----+
    |id   |name  |age  |
    +-----+------+-----+
    |1    |SPJ   |40   |
    +-----+------+-----+
    |2    |Simon |41   |
    +-----+------+-----+
    |3    |Snake |38   |
    +-----+------+-----+
    |4    |Eva   |38   |
    +-----+------+-----+
    

  8. insertMany :: forall record (m :: Type -> Type) . (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m [Key record]

    esqueleto Database.Esqueleto

    Create multiple records in the database and return their Keys. If you don't need the inserted Keys, use insertMany_. The MongoDB and PostgreSQL backends insert all records and retrieve their keys in one database query. The SQLite and MySQL backends use the slow, default implementation of mapM insert.

    Example usage

    with schema-1 and dataset-1,
    insertUsers :: MonadIO m => ReaderT SqlBackend m [Key User]
    insertUsers = insertMany [User "John" 30, User "Nick" 32, User "Jane" 20]
    
    userIds <- insertUsers
    
    The above query when applied on dataset-1, will produce this:
    +-----+------+-----+
    |id   |name  |age  |
    +-----+------+-----+
    |1    |SPJ   |40   |
    +-----+------+-----+
    |2    |Simon |41   |
    +-----+------+-----+
    |3    |John  |30   |
    +-----+------+-----+
    |4    |Nick  |32   |
    +-----+------+-----+
    |5    |Jane  |20   |
    +-----+------+-----+
    

  9. insertMany_ :: forall record (m :: Type -> Type) . (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m ()

    esqueleto Database.Esqueleto

    Same as insertMany, but doesn't return any Keys. The MongoDB, PostgreSQL, SQLite and MySQL backends insert all records in one database query.

    Example usage

    With schema-1 and dataset-1,
    insertUsers_ :: MonadIO m => ReaderT SqlBackend m ()
    insertUsers_ = insertMany_ [User "John" 30, User "Nick" 32, User "Jane" 20]
    
    The above query when applied on dataset-1, will produce this:
    +-----+------+-----+
    |id   |name  |age  |
    +-----+------+-----+
    |1    |SPJ   |40   |
    +-----+------+-----+
    |2    |Simon |41   |
    +-----+------+-----+
    |3    |John  |30   |
    +-----+------+-----+
    |4    |Nick  |32   |
    +-----+------+-----+
    |5    |Jane  |20   |
    +-----+------+-----+
    

  10. putMany :: forall record (m :: Type -> Type) . (PersistUniqueWrite backend, MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m ()

    esqueleto Database.Esqueleto

    Put many records into db

    • insert new records that do not exist (or violate any unique constraints)
    • replace existing records (matching any unique constraint)

Page 149 of many | Previous | Next