From fe53309b05f44733b4222d10eab496354d5a546d Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 29 Sep 2017 11:41:24 -0400 Subject: [PATCH] Define a generically-derivable lifting of Ord to * -> *. --- src/Data/Functor/Classes/Ord/Generic.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Data/Functor/Classes/Ord/Generic.hs b/src/Data/Functor/Classes/Ord/Generic.hs index 0948974ff..a3e4b7aae 100644 --- a/src/Data/Functor/Classes/Ord/Generic.hs +++ b/src/Data/Functor/Classes/Ord/Generic.hs @@ -1 +1,8 @@ module Data.Functor.Classes.Ord.Generic where + +-- | Generically-derivable lifting of the 'Ord' class to unary type constructors. +class GOrd1 f where + -- | Lift a comparison function through the type constructor. + -- + -- The function will usually be applied to a comparison function, but the more general type ensures that the implementation uses it to compare elements of the first container with elements of the second. + gliftCompare :: (a -> b -> Ordering) -> f a -> f b -> Ordering