From 86e15f4bb5b30266e4a6e83f13576be925479ca0 Mon Sep 17 00:00:00 2001 From: Sophie Taylor Date: Thu, 22 Aug 2019 11:51:16 +1000 Subject: [PATCH 1/2] PartialOrd default impl. for `leq` via Ord Just makes things easier. --- src/Algebra/PartialOrd.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Algebra/PartialOrd.hs b/src/Algebra/PartialOrd.hs index 4c62535..431ed3c 100644 --- a/src/Algebra/PartialOrd.hs +++ b/src/Algebra/PartialOrd.hs @@ -84,7 +84,9 @@ import Data.Void (Void) class Eq a => PartialOrd a where -- | The relation that induces the partial ordering leq :: a -> a -> Bool - + {-# INLINE leq #-} + default leq :: Ord a => a -> a -> Bool + leq = (<=) -- | Whether two elements are ordered with respect to the relation. A -- default implementation is given by -- From 1ed6ebbb67f4d1dc37a0f9aeab6f40a70f247598 Mon Sep 17 00:00:00 2001 From: Sophie Taylor Date: Thu, 22 Aug 2019 13:01:23 +1000 Subject: [PATCH 2/2] DefaultSignatures --- src/Algebra/PartialOrd.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Algebra/PartialOrd.hs b/src/Algebra/PartialOrd.hs index 431ed3c..ae6f95f 100644 --- a/src/Algebra/PartialOrd.hs +++ b/src/Algebra/PartialOrd.hs @@ -1,4 +1,5 @@ {-# LANGUAGE Safe #-} +{-# LANGUAGE DefaultSignatures #-} ---------------------------------------------------------------------------- -- | -- Module : Algebra.PartialOrd