packages feed

rio 0.1.6.0 → 0.1.7.0

raw patch · 5 files changed

+31/−5 lines, 5 files

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for rio +## 0.1.7.0++* Addition of `textDisplay` to `Display` class.+ ## 0.1.6.0  * Changed `logUseColor` to default to `False` on Windows, even when verbose and on the terminal
rio.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.30.0.+-- This file has been generated from package.yaml by hpack version 0.31.1. -- -- see: https://github.com/sol/hpack ----- hash: bbb48d8141804c3559dabe44ac2317e1d0fae65893cea408ee1fb4297e974f6a+-- hash: b91cb0c2c4bba78233563166dd6cd73b36b53c63115f7eab1f663f63e211f482  name:           rio-version:        0.1.6.0+version:        0.1.7.0 synopsis:       A standard library for Haskell description:    See README and Haddocks at <https://www.stackage.org/package/rio> category:       Control
src/RIO/List.hs view
@@ -274,9 +274,9 @@ minimumMaybe = safeListCall Data.List.minimum  -- | @since 0.1.3.0-maximumByMaybe :: (Ord a, Foldable t) => (a -> a -> Ordering) -> t a -> Maybe a+maximumByMaybe :: (Foldable t) => (a -> a -> Ordering) -> t a -> Maybe a maximumByMaybe f = safeListCall (Data.List.maximumBy f)  -- | @since 0.1.3.0-minimumByMaybe :: (Ord a, Foldable t) => (a -> a -> Ordering) -> t a -> Maybe a+minimumByMaybe :: (Foldable t) => (a -> a -> Ordering) -> t a -> Maybe a minimumByMaybe f = safeListCall (Data.List.minimumBy f)
src/RIO/Prelude/Display.hs view
@@ -42,7 +42,17 @@ -- -- @since 0.1.0.0 class Display a where+  {-# MINIMAL display | textDisplay #-}+   display :: a -> Utf8Builder+  display = display . textDisplay++  -- | Display data as `Text`, which will also be used for `display` if it is+  -- not overriden.+  --+  -- @since 0.1.7.0+  textDisplay :: a -> Text+  textDisplay = utf8BuilderToText . display  -- | @since 0.1.0.0 instance Display Utf8Builder where
test/RIO/ListSpec.hs view
@@ -5,6 +5,12 @@ import RIO import qualified RIO.List as List +data TestType = TestType { testTypeContents :: Int }+  deriving (Eq, Show)++testTypeList :: [TestType]+testTypeList = [TestType { testTypeContents = 1 }, TestType { testTypeContents = 0 }]+ spec :: Spec spec = do   describe "dropPrefix" $ do@@ -13,3 +19,9 @@   describe "dropSuffix" $ do     it "present" $ List.dropSuffix "bar" "foobar" `shouldBe` "foo"     it "absent" $ List.dropSuffix "foo" "foobar" `shouldBe` "foobar"+  describe "maximumByMaybe" $ do+    it "should support elements that do not have an Ord instance" $+      List.maximumByMaybe (compare `on` testTypeContents) testTypeList `shouldBe` (Just TestType { testTypeContents = 1})+  describe "minimumByMaybe" $ do+    it "should support elements that do not have an Ord instance" $+      List.minimumByMaybe (compare `on` testTypeContents) testTypeList `shouldBe` (Just TestType { testTypeContents = 0})