on 9216dbd help sign in
rel8/src/Rel8/Order.hs
29 lines 861 B history raw
1{-# language DerivingStrategies #-}
2{-# language GeneralizedNewtypeDeriving #-}
3{-# language StandaloneKindSignatures #-}
5module Rel8.Order
6 ( Order(..)
7 )
8where
10-- base
11import Data.Functor.Contravariant ( Contravariant )
12import Data.Kind ( Type )
13import Prelude
15-- contravariant
16import Data.Functor.Contravariant.Divisible ( Decidable, Divisible )
18-- opaleye
19import qualified Opaleye.Internal.Order as Opaleye
22-- | An ordering expression for @a@. Primitive orderings are defined with 'asc'
23-- and 'desc', and you can combine @Order@ via its various instances.
24--
25-- A common pattern is to use '<>' to combine multiple orderings in sequence,
26-- and '>$<' (from 'Contravariant') to select individual columns.
27type Order :: Type -> Type
28newtype Order a = Order (Opaleye.Order a)
29 deriving newtype (Contravariant, Divisible, Decidable, Semigroup, Monoid)