1{-# language DerivingStrategies #-}
2{-# language GeneralizedNewtypeDeriving #-}
3{-# language StandaloneKindSignatures #-}
12import Data.Functor.Contravariant ( Contravariant )
13import Data.Kind ( Type )
17import Data.Functor.Contravariant.Divisible ( Decidable, Divisible )
20import qualified Opaleye.Internal.HaskellDB.PrimQuery as Opaleye
21import qualified Opaleye.Internal.Order as Opaleye
24-- | An ordering expression for @a@. Primitive orderings are defined with
25-- 'Rel8.asc' and 'Rel8.desc', and you can combine @Order@ via its various
28-- A common pattern is to use '<>' to combine multiple orderings in sequence,
29-- and '>$<' (from 'Contravariant') to select individual columns.
30type Order :: Type -> Type
31newtype Order a = Order (Opaleye.Order a)
32 deriving newtype (Contravariant, Divisible, Decidable, Semigroup, Monoid)
35toOrderExprs :: Order a -> a -> [Opaleye.OrderExpr]
36toOrderExprs (Order (Opaleye.Order order)) a =
37 uncurry Opaleye.OrderExpr <$> order a
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list