packages feed

classy-prelude 0.5.1 → 0.5.2

raw patch · 4 files changed

+12/−8 lines, 4 filesdep ~basic-prelude

Dependency ranges changed: basic-prelude

Files

ClassyPrelude.hs view
@@ -255,5 +255,5 @@ -- | Sort elements using the user supplied function to project something out of -- each element. -- Inspired by <http://hackage.haskell.org/packages/archive/base/latest/doc/html/GHC-Exts.html#v:sortWith>.-sortWith :: (CanSortBy c a, Ord b) => (a -> b) -> c a -> c a+sortWith :: (CanSortBy c a, Ord b) => (a -> b) -> c -> c sortWith f = sortBy $ comparing f
ClassyPrelude/Classes.hs view
@@ -183,10 +183,12 @@ class CanIntersection c where     intersection :: c -> c -> c -class CanSortBy c a where-    sortBy :: (a -> a -> Ordering) -> c a -> c a-    sort :: c a -> c a-    default sort :: (Ord a) => c a -> c a+class CanSortBy c a | c -> a where+    sortBy :: (a -> a -> Ordering) -> c -> c++class Ord a => CanSort c a | c -> a where+    sort :: c -> c+    default sort :: CanSortBy c a => c -> c     sort = sortBy compare  class CanCons c a where
ClassyPrelude/List.hs view
@@ -131,8 +131,10 @@ instance (Eq a) => CanIntersection [a] where     intersection = List.intersect -instance (Ord a) => CanSortBy [] a where+instance CanSortBy [a] a where     sortBy = List.sortBy+instance Ord a => CanSort [a] a where+    sort = List.sort  instance CanCons [a] a where     cons = (:)
classy-prelude.cabal view
@@ -1,5 +1,5 @@ name:                classy-prelude-version:             0.5.1+version:             0.5.2 synopsis:            A typeclass-based Prelude. description:         Focuses on using common typeclasses when possible, and creating new ones to avoid name clashing. Exposes many recommended datastructures (Map, ByteString, etc) directly without requiring long import lists and qualified modules. homepage:            https://github.com/snoyberg/classy-prelude@@ -28,7 +28,7 @@                        ClassyPrelude.HashSet                        ClassyPrelude.Char   build-depends:       base                          >= 4          && < 5-                     , basic-prelude                 >= 0.3.2      && < 0.4+                     , basic-prelude                 >= 0.3.3      && < 0.4                      , system-filepath               >= 0.4        && < 0.5                      , transformers                      , containers                    >= 0.4.2