]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Query/Filter.hs
merging phylo with uniform distribution of terms in quality AND selection of eligible...
[gargantext.git] / src / Gargantext / Database / Query / Filter.hs
1 {-|
2 Module : Gargantext.Database.Query.Filter
3 Description : Main requests of Node to the database
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9 -}
10
11 {-# OPTIONS_GHC -fno-warn-name-shadowing #-}
12
13 {-# LANGUAGE Arrows #-}
14 {-# LANGUAGE FunctionalDependencies #-}
15 {-# LANGUAGE TemplateHaskell #-}
16 {-# OPTIONS_GHC -fno-warn-orphans #-}
17
18 module Gargantext.Database.Query.Filter
19 where
20
21 import Gargantext.Core.Types (Limit, Offset)
22 import Data.Maybe (Maybe, maybe)
23 import Opaleye (Query, limit, offset)
24
25 limit' :: Maybe Limit -> Query a -> Query a
26 limit' maybeLimit query = maybe query (\l -> limit l query) maybeLimit
27
28 offset' :: Maybe Offset -> Query a -> Query a
29 offset' maybeOffset query = maybe query (\o -> offset o query) maybeOffset
30
31