]> Git — Sourcephile - haskell/interval.git/commitdiff
Remove redundant Ord constraints. master
authorJulien Moutinho <julm+interval@autogeree.net>
Sat, 10 Dec 2016 22:19:58 +0000 (23:19 +0100)
committerJulien Moutinho <julm+interval@autogeree.net>
Sat, 10 Dec 2016 22:19:58 +0000 (23:19 +0100)
Data/Interval.hs
Data/Interval/Sieve.hs
interval.cabal

index 5a3b67c36a7dd104303c45746800180f9bdb4d87..d8b98c43c7868c6fb9b191999fde39177bb4496d 100644 (file)
@@ -433,7 +433,7 @@ instance (Ord x, Show x) => Show (Pretty (Interval x)) where
                         In  -> "]"
                         Out -> "["
                 ]
-instance (Ord x, Show x) => Show (Pretty (Unlimitable x)) where
+instance Show x => Show (Pretty (Unlimitable x)) where
        show (Pretty x) =
                case x of
                 Unlimited_low  -> "-oo"
index 9225f2ed6de37b15a16507119b621e3efbcaab1f..183e06811524b46736c7271a3234a53341008fa9 100644 (file)
@@ -51,21 +51,19 @@ instance (Ord x, Show x) => Show (Pretty (Sieve x)) where
 
 -- | Like 'Data.Functor.fmap' but working on 'Interval's.
 fmap_interval
- :: (Ord x, Ord y)
- => (Interval x -> Interval y) -> Sieve x -> Sieve y
+ :: (Interval x -> Interval y) -> Sieve x -> Sieve y
 fmap_interval f (Sieve ft) = Sieve (FT.fmap' f ft)
 
 -- | Like 'Data.Functor.fmap' but working on 'Interval's,
 --   and safe only if 'Measure' is preserved.
 fmap_interval_unsafe
- :: Ord x
- => (Interval x -> Interval x)
+ :: (Interval x -> Interval x)
  -> Sieve x -> Sieve x
 fmap_interval_unsafe f (Sieve ft) = Sieve (FT.unsafeFmap f ft)
 
 -- | Like 'Data.Traversable.traverse' but working on 'Interval's.
 traverse_interval
- :: (Ord x, Ord y, Applicative f)
+ :: Applicative f
  => (Interval x -> f (Interval y))
  -> Sieve x -> f (Sieve y)
 traverse_interval f (Sieve ft) = Sieve <$> FT.traverse' f ft
@@ -73,7 +71,7 @@ traverse_interval f (Sieve ft) = Sieve <$> FT.traverse' f ft
 -- | Like 'Data.Traversable.traverse' but working on 'Interval's,
 --   and safe only if 'Measure' is preserved.
 traverse_interval_unsafe
- :: (Ord x, Applicative f)
+ :: Applicative f
  => (Interval x -> f (Interval x))
  -> Sieve x -> f (Sieve x)
 traverse_interval_unsafe f (Sieve ft) = Sieve <$> FT.unsafeTraverse f ft
@@ -95,7 +93,7 @@ data Measure x
        --   and thus not be the 'max' 'Interval').
   -}
    }
-instance Ord x => Monoid (Measure x) where
+instance Monoid (Measure x) where
        mempty = Measure_Empty
        
        Measure_Empty `mappend` i  = i
@@ -114,17 +112,17 @@ instance Ord x => Monoid (Measure x) where
                         (Out, Out) -> max_high i
                 GT -> max_high i
        -}
-instance Ord x => FT.Measured (Measure x) (Interval x) where
+instance FT.Measured (Measure x) (Interval x) where
        measure = Measure
 
-empty :: Ord x => Sieve x
+empty :: Sieve x
 empty = Sieve FT.empty
 
 -- | Return the 'True' iif. the given 'Sieve' is 'empty'.
-null :: Ord x => Sieve x -> Bool
+null :: Sieve x -> Bool
 null (Sieve ft) = FT.null ft
 
-singleton :: Ord x => Interval x -> Sieve x
+singleton :: Interval x -> Sieve x
 singleton = Sieve . FT.singleton
 
 -- | Return an 'Interval' with:
@@ -142,7 +140,7 @@ interval (Sieve ft) =
                 _ :> r    -> Just $ Interval (low l, high r)
 
 -- | All the 'Interval's of the 'Sieve' in '..<<..' order.
-intervals :: Ord x => Sieve x -> [Interval x]
+intervals :: Sieve x -> [Interval x]
 intervals (Sieve t) = Foldable.toList t
 
 -- * Union
index 1d05b025c3b7b3baa6ef2ba8d9aa873884d64f56..dba2983e4f0eef6453210e59df2ab025e102c9da 100644 (file)
@@ -21,8 +21,8 @@ maintainer: Julien Moutinho <julm+haskell+interval@autogeree.net>
 name: interval
 stability: experimental
 synopsis: Intervals with adherences.
-tested-with: GHC==7.10.3
-version: 1.20160826
+tested-with: GHC==8.0.1
+version: 1.20161210
 
 source-repository head
   location: git://git.autogeree.net/haskell/interval