From: Nick Bowler Date: Wed, 24 Feb 2010 03:13:19 +0000 (-0500) Subject: floating: Add a Sortable constraint for PrimFloat. X-Git-Url: https://repo.or.cz/w/altfloat.git/commitdiff_plain/19963f4b29f226ecbb659075f18339e57667db4c floating: Add a Sortable constraint for PrimFloat. Every instance of this class should be sortable, thus we don't need to pollute type signatures elsewhere. --- diff --git a/Data/Floating/Types/Core.hs b/Data/Floating/Types/Core.hs index d3c2ff3..092d4b6 100644 --- a/Data/Floating/Types/Core.hs +++ b/Data/Floating/Types/Core.hs @@ -13,8 +13,10 @@ module Data.Floating.Types.Core where import Prelude hiding (Double, Float, Ord(..), RealFrac(..), Floating(..), RealFloat(..)) + import Data.Ratio import Data.Roundable +import Data.Poset import GHC.Integer import GHC.Prim @@ -117,7 +119,7 @@ class Floating a => RealFloat a where pi = 4 * atan 1 -- | Class for the basic floating point types. -class (Roundable a, RealFloat a) => PrimFloat a where +class (Roundable a, Sortable a, RealFloat a) => PrimFloat a where -- | Radix of significand digits. floatRadix :: Num b => a -> b -- | Number of digits in the significand.