packages feed

base-prelude 0.1.7 → 0.1.8

raw patch · 2 files changed

+15/−3 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ BasePrelude: Down :: a -> Down a
+ BasePrelude: instance Eq a => Eq (Down a)
+ BasePrelude: instance Ord a => Ord (Down a)
+ BasePrelude: instance Read a => Read (Down a)
+ BasePrelude: instance Show a => Show (Down a)
+ BasePrelude: newtype Down a

Files

base-prelude.cabal view
@@ -1,7 +1,7 @@ name:   base-prelude version:-  0.1.7+  0.1.8 synopsis:   The most complete prelude formed from only the "base" package description:
library/BasePrelude.hs view
@@ -13,6 +13,8 @@   traceShowId,   traceM,   traceShowM,+  -- ** Data.Ord+  Down(..), ) where @@ -42,7 +44,6 @@ import Data.List as Exports hiding (concat, foldr, foldl1, maximum, minimum, product, sum, all, and, any, concatMap, elem, foldl, foldr1, notElem, or, find, maximumBy, minimumBy, mapAccumL, mapAccumR, foldl') import Data.Maybe as Exports import Data.Monoid as Exports-import Data.Ord as Exports (Down(..)) import Data.Ratio as Exports import Data.STRef as Exports import Data.String as Exports@@ -52,7 +53,7 @@ import Data.Word as Exports import Debug.Trace as Exports hiding (traceShowId, traceM, traceShowM) import GHC.Conc as Exports hiding (withMVar, threadWaitWriteSTM, threadWaitWrite, threadWaitReadSTM, threadWaitRead)-import GHC.Exts as Exports (lazy, inline)+import GHC.Exts as Exports (lazy, inline, sortWith, groupWith) import GHC.Generics as Exports (Generic) import GHC.IO.Exception as Exports import Prelude as Exports hiding (concat, foldr, mapM_, sequence_, foldl1, maximum, minimum, product, sum, all, and, any, concatMap, elem, foldl, foldr1, notElem, or, mapM, sequence, FilePath, id, (.))@@ -107,3 +108,14 @@ -} traceShowM :: (Show a, Monad m) => a -> m () traceShowM = traceM . show++-- | The 'Down' type allows you to reverse sort order conveniently.  A value of type+-- @'Down' a@ contains a value of type @a@ (represented as @'Down' a@).+-- If @a@ has an @'Ord'@ instance associated with it then comparing two+-- values thus wrapped will give you the opposite of their normal sort order.+-- This is particularly useful when sorting in generalised list comprehensions,+-- as in: @then sortWith by 'Down' x@+newtype Down a = Down a deriving (Eq, Show, Read)++instance Ord a => Ord (Down a) where+  compare (Down x) (Down y) = y `compare` x