Hoogle Search

Within LTS Haskell 22.43 (ghc-9.6.6)

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

  1. selectList :: forall record backend m . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m [Entity record]

    persistent Database.Persist.Class

    Returns a [Entity record] corresponding to the filters and options provided. Filters are constructed using the operators defined in Database.Persist (and re-exported from Database.Persist.Sql). Let's look at some examples:

    usersWithAgeOver40 :: SqlPersistT IO [Entity User]
    usersWithAgeOver40 =
    selectList [UserAge >=. 40] []
    
    If you provide multiple values in the list, the conditions are ANDed together.
    usersWithAgeBetween30And50 :: SqlPersistT IO [Entity User]
    usersWithAgeBetween30And50 =
    selectList
    [ UserAge >=. 30
    , UserAge <=. 50
    ]
    []
    
    The second list contains the SelectOpt for a record. We can select the first ten records with LimitTo
    firstTenUsers =
    selectList [] [LimitTo 10]
    
    And we can select the second ten users with OffsetBy.
    secondTenUsers =
    selectList [] [LimitTo 10, OffsetBy 10]
    
    Warning that LIMIT/OFFSET is bad for pagination! The type of record can usually be infered from the types of the provided filters and select options. In the previous two examples, though, you'll notice that the select options are polymorphic, applying to any record type. In order to help type inference in such situations, or simply as an enhancement to readability, you might find type application useful, illustrated below.
    {-# LANGUAGE TypeApplications #-}
    ...
    
    firstTenUsers =
    selectList User [] [LimitTo 10]
    
    secondTenUsers =
    selectList User [] [LimitTo 10, OffsetBy 10]
    
    With Asc and Desc, we can provide the field we want to sort on. We can provide multiple sort orders - later ones are used to sort records that are equal on the first field.
    newestUsers =
    selectList [] [Desc UserCreatedAt, LimitTo 10]
    
    oldestUsers =
    selectList [] [Asc UserCreatedAt, LimitTo 10]
    

  2. selectList :: forall record backend m . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m [Entity record]

    persistent Database.Persist.Class.PersistQuery

    Returns a [Entity record] corresponding to the filters and options provided. Filters are constructed using the operators defined in Database.Persist (and re-exported from Database.Persist.Sql). Let's look at some examples:

    usersWithAgeOver40 :: SqlPersistT IO [Entity User]
    usersWithAgeOver40 =
    selectList [UserAge >=. 40] []
    
    If you provide multiple values in the list, the conditions are ANDed together.
    usersWithAgeBetween30And50 :: SqlPersistT IO [Entity User]
    usersWithAgeBetween30And50 =
    selectList
    [ UserAge >=. 30
    , UserAge <=. 50
    ]
    []
    
    The second list contains the SelectOpt for a record. We can select the first ten records with LimitTo
    firstTenUsers =
    selectList [] [LimitTo 10]
    
    And we can select the second ten users with OffsetBy.
    secondTenUsers =
    selectList [] [LimitTo 10, OffsetBy 10]
    
    Warning that LIMIT/OFFSET is bad for pagination! The type of record can usually be infered from the types of the provided filters and select options. In the previous two examples, though, you'll notice that the select options are polymorphic, applying to any record type. In order to help type inference in such situations, or simply as an enhancement to readability, you might find type application useful, illustrated below.
    {-# LANGUAGE TypeApplications #-}
    ...
    
    firstTenUsers =
    selectList User [] [LimitTo 10]
    
    secondTenUsers =
    selectList User [] [LimitTo 10, OffsetBy 10]
    
    With Asc and Desc, we can provide the field we want to sort on. We can provide multiple sort orders - later ones are used to sort records that are equal on the first field.
    newestUsers =
    selectList [] [Desc UserCreatedAt, LimitTo 10]
    
    oldestUsers =
    selectList [] [Asc UserCreatedAt, LimitTo 10]
    

  3. selectList :: forall record backend (m :: Type -> Type) . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m [Entity record]

    classy-prelude-yesod ClassyPrelude.Yesod

    Returns a [Entity record] corresponding to the filters and options provided. Filters are constructed using the operators defined in Database.Persist (and re-exported from Database.Persist.Sql). Let's look at some examples:

    usersWithAgeOver40 :: SqlPersistT IO [Entity User]
    usersWithAgeOver40 =
    selectList [UserAge >=. 40] []
    
    If you provide multiple values in the list, the conditions are ANDed together.
    usersWithAgeBetween30And50 :: SqlPersistT IO [Entity User]
    usersWithAgeBetween30And50 =
    selectList
    [ UserAge >=. 30
    , UserAge <=. 50
    ]
    []
    
    The second list contains the SelectOpt for a record. We can select the first ten records with LimitTo
    firstTenUsers =
    selectList [] [LimitTo 10]
    
    And we can select the second ten users with OffsetBy.
    secondTenUsers =
    selectList [] [LimitTo 10, OffsetBy 10]
    
    Warning that LIMIT/OFFSET is bad for pagination! The type of record can usually be infered from the types of the provided filters and select options. In the previous two examples, though, you'll notice that the select options are polymorphic, applying to any record type. In order to help type inference in such situations, or simply as an enhancement to readability, you might find type application useful, illustrated below.
    {-# LANGUAGE TypeApplications #-}
    ...
    
    firstTenUsers =
    selectList User [] [LimitTo 10]
    
    secondTenUsers =
    selectList User [] [LimitTo 10, OffsetBy 10]
    
    With Asc and Desc, we can provide the field we want to sort on. We can provide multiple sort orders - later ones are used to sort records that are equal on the first field.
    newestUsers =
    selectList [] [Desc UserCreatedAt, LimitTo 10]
    
    oldestUsers =
    selectList [] [Asc UserCreatedAt, LimitTo 10]
    

  4. selectList :: forall record backend (m :: Type -> Type) . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m [Entity record]

    hledger-web Hledger.Web.Import

    Returns a [Entity record] corresponding to the filters and options provided. Filters are constructed using the operators defined in Database.Persist (and re-exported from Database.Persist.Sql). Let's look at some examples:

    usersWithAgeOver40 :: SqlPersistT IO [Entity User]
    usersWithAgeOver40 =
    selectList [UserAge >=. 40] []
    
    If you provide multiple values in the list, the conditions are ANDed together.
    usersWithAgeBetween30And50 :: SqlPersistT IO [Entity User]
    usersWithAgeBetween30And50 =
    selectList
    [ UserAge >=. 30
    , UserAge <=. 50
    ]
    []
    
    The second list contains the SelectOpt for a record. We can select the first ten records with LimitTo
    firstTenUsers =
    selectList [] [LimitTo 10]
    
    And we can select the second ten users with OffsetBy.
    secondTenUsers =
    selectList [] [LimitTo 10, OffsetBy 10]
    
    Warning that LIMIT/OFFSET is bad for pagination! The type of record can usually be infered from the types of the provided filters and select options. In the previous two examples, though, you'll notice that the select options are polymorphic, applying to any record type. In order to help type inference in such situations, or simply as an enhancement to readability, you might find type application useful, illustrated below.
    {-# LANGUAGE TypeApplications #-}
    ...
    
    firstTenUsers =
    selectList User [] [LimitTo 10]
    
    secondTenUsers =
    selectList User [] [LimitTo 10, OffsetBy 10]
    
    With Asc and Desc, we can provide the field we want to sort on. We can provide multiple sort orders - later ones are used to sort records that are equal on the first field.
    newestUsers =
    selectList [] [Desc UserCreatedAt, LimitTo 10]
    
    oldestUsers =
    selectList [] [Asc UserCreatedAt, LimitTo 10]
    

  5. selectList :: (WidgetModel s, WidgetEvent e, Traversable t, SelectListItem a) => ALens' s a -> t a -> SelectListMakeRow s e a -> WidgetNode s e

    monomer Monomer.Widgets.Containers.SelectList

    Creates a select list using the given lens.

  6. selectList :: (PersistRecordBackend record SqlBackend, Typeable record, MonadSqlQuery m) => [Filter record] -> [SelectOpt record] -> m [Entity record]

    persistent-mtl Database.Persist.Monad.Shim

    The lifted version of selectList

  7. selectList :: (PersistRecordBackend record SqlBackend, Typeable record, MonadSqlQuery m) => [Filter record] -> [SelectOpt record] -> m [Entity record]

    persistent-mtl Database.Persist.Sql.Shim

    The lifted version of selectList

  8. module Monomer.Widgets.Containers.SelectList

    Select list widget, allowing selection of a single item. List content (rows) is customizable, and so is its styling. This widget is used by Monomer.Widgets.Containers.Dropdown when in its open state.

    makeRow username = hstack [
    label "User: ",
    label username
    ]
    
    customSelect = selectList userLens usernames makeRow
    
    Note: the content of the list will only be updated when the provided items change, based on their Eq instance. In case data external to the items is used for building the row nodes, mergeRequired may be needed to avoid stale content.

  9. SelectList :: PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Entity record]

    persistent-mtl Database.Persist.Monad.SqlQueryRep

    Constructor corresponding to selectList

  10. SelectList :: PersistRecordBackend record SqlBackend => [Filter record] -> [SelectOpt record] -> SqlQueryRep record [Entity record]

    persistent-mtl Database.Persist.Monad.TestUtils

    Constructor corresponding to selectList

Page 1 of many | Next