Hoogle Search

Within LTS Haskell 24.27 (ghc-9.10.3)

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

  1. toList :: Word64Set -> [Key]

    ghc GHC.Data.Word64Set

    Convert the set to a list of elements. Subject to list fusion.

  2. fromAscList :: [Key] -> Word64Set

    ghc GHC.Data.Word64Set.Internal

    Build a set from an ascending list of elements. The precondition (input list is ascending) is not checked.

  3. fromDistinctAscList :: [Key] -> Word64Set

    ghc GHC.Data.Word64Set.Internal

    Build a set from an ascending list of distinct elements. The precondition (input list is strictly ascending) is not checked.

  4. fromList :: [Key] -> Word64Set

    ghc GHC.Data.Word64Set.Internal

    Create a set from a list of integers.

  5. toAscList :: Word64Set -> [Key]

    ghc GHC.Data.Word64Set.Internal

    Convert the set to an ascending list of elements. Subject to list fusion.

  6. toDescList :: Word64Set -> [Key]

    ghc GHC.Data.Word64Set.Internal

    Convert the set to a descending list of elements. Subject to list fusion.

  7. toList :: Word64Set -> [Key]

    ghc GHC.Data.Word64Set.Internal

    Convert the set to a list of elements. Subject to list fusion.

  8. selectKeysList :: forall record backend (m :: Type -> Type) . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m [Key record]

    persistent Database.Persist.Class

    Call selectKeys but return the result as a list.

  9. selectList :: forall record backend (m :: Type -> Type) . (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]
    

  10. selectKeysList :: forall record backend (m :: Type -> Type) . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m [Key record]

    persistent Database.Persist.Class.PersistQuery

    Call selectKeys but return the result as a list.

Page 65 of many | Previous | Next