From fa634a0d7174a82b4eff5b8c845cac4da1722496 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Fri, 20 Nov 2009 11:46:44 -0500 Subject: [PATCH] poset: Export the Ord class (but not its methods). --- Data/Poset.hs | 2 +- Data/Poset/Internal.hs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Data/Poset.hs b/Data/Poset.hs index d306eec..107ed92 100644 --- a/Data/Poset.hs +++ b/Data/Poset.hs @@ -8,7 +8,7 @@ module Data.Poset ( Poset(..), Sortable(..), Ordering(..), - module Data.Poset + module Data.Poset, Ord ) where import Prelude hiding (Ord(..), Ordering(..)) diff --git a/Data/Poset/Internal.hs b/Data/Poset/Internal.hs index ab9d4b4..9056cdb 100644 --- a/Data/Poset/Internal.hs +++ b/Data/Poset/Internal.hs @@ -1,9 +1,12 @@ {-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-} -module Data.Poset.Internal where +module Data.Poset.Internal ( + module Data.Poset.Internal, Ord +) where import qualified Data.List as List import qualified Prelude import Prelude hiding (Ordering(..), Ord(..)) +import Prelude (Ord) import Data.Monoid @@ -106,7 +109,7 @@ class Poset a => Sortable a where -- Any totally ordered set is a partially ordered set. It remains to be seen -- if UndecidableInstances needed to support this cause any problems. -instance Prelude.Ord a => Poset a where +instance Ord a => Poset a where compare = (partialOrder .) . Prelude.compare (<) = (Prelude.<) (<=) = (Prelude.<=) @@ -116,7 +119,7 @@ instance Prelude.Ord a => Poset a where (>) = (Prelude.>) -- Any list whose element set is totally ordered is sortable. -instance Prelude.Ord a => Sortable a where +instance Ord a => Sortable a where sortBy f = List.sortBy ((totalOrder .) . f) isSignificant = const True max = Prelude.max -- 2.11.4.GIT