@@ -28,6 +28,8 @@ import Rel8.Table.Ord
2828import Rel8.Type.Ord
2929
3030
31+-- | Construct an 'Order' for a 'Table' by sorting all columns into ascending
32+-- orders (any nullable columns will be sorted with @NULLS FIRST@).
3133ascTable :: forall a. OrdTable a => Order a
3234ascTable = contramap toColumns $ getConst $
3335 htabulateA @(Columns a) $ \field -> case hfield hspecs field of
@@ -39,6 +41,8 @@ ascTable = contramap toColumns $ getConst $
3941 ords = hdicts @(Columns a) @(ConstrainDBType DBOrd)
4042
4143
44+-- | Construct an 'Order' for a 'Table' by sorting all columns into descending
45+-- orders (any nullable columns will be sorted with @NULLS LAST@).
4246descTable :: forall a. OrdTable a => Order a
4347descTable = contramap toColumns $ getConst $
4448 htabulateA @(Columns a) $ \field -> case hfield hspecs field of