packages feed

classy-prelude 0.10.5 → 0.11.0

raw patch · 4 files changed

+35/−2 lines, 4 filesdep +dlistdep ~chunked-datadep ~mutable-containersPVP ok

version bump matches the API change (PVP)

Dependencies added: dlist

Dependency ranges changed: chunked-data, mutable-containers

API changes (from Hackage documentation)

+ ClassyPrelude: applyDList :: DList a -> [a] -> [a]
+ ClassyPrelude: asDList :: DList a -> DList a
+ ClassyPrelude: data DList a :: * -> *

Files

ChangeLog.md view
@@ -1,3 +1,8 @@+## 0.11.0++* Upgrade to mutable-containers 0.3+* Include dlist support+ ## 0.10.5  * Export `Data.Mutable`
ClassyPrelude.hs view
@@ -139,6 +139,10 @@     , fpFromText     , fpToTextWarn     , fpToTextEx+      -- ** Difference lists+    , DList+    , asDList+    , applyDList       -- ** Exceptions     , module Control.Exception.Enclosed     , MonadThrow (throwM)@@ -224,6 +228,8 @@ import Data.Functor.Identity (Identity (..)) import Control.Monad.Reader (MonadReader, ask, ReaderT (..), Reader) import Data.Bifunctor+import Data.DList (DList)+import qualified Data.DList as DList  tshow :: Show a => a -> Text tshow = fromList . Prelude.show@@ -585,3 +591,17 @@ sequence_ :: (Monad m, MonoFoldable mono, Element mono ~ (m a)) => mono -> m () sequence_ = mapM_ (>> return ()) {-# INLINE sequence_ #-}++-- | Force type to a 'DList'+--+-- Since 0.11.0+asDList :: DList a -> DList a+asDList = id+{-# INLINE asDList #-}++-- | Synonym for 'DList.apply'+--+-- Since 0.11.0+applyDList :: DList a -> [a] -> [a]+applyDList = DList.apply+{-# INLINE applyDList #-}
classy-prelude.cabal view
@@ -1,5 +1,5 @@ name:                classy-prelude-version:             0.10.5+version:             0.11.0 synopsis:            A typeclass-based Prelude. description:         Modern best practices without name collisions. No partial functions are exposed, but modern data structures are, without requiring import lists. Qualified modules also are not needed: instead operations are based on type-classes from the mono-traversable package. @@ -39,7 +39,8 @@                      , primitive                      , mtl                      , bifunctors-                     , mutable-containers >= 0.2 && < 0.3+                     , mutable-containers >= 0.3 && < 0.4+                     , dlist >= 0.7   ghc-options:         -Wall -fno-warn-orphans  test-suite test
test/main.hs view
@@ -402,6 +402,13 @@                     | Just DummyException <- fromException e -> return ()                     | otherwise -> error "Expected a DummyException"                 Right () -> error "Expected an exception" :: IO ()+    it "basic DList functionality" $+        (toList $ asDList $ mconcat+            [ fromList [1, 2]+            , singleton 3+            , cons 4 mempty+            , fromList $ applyDList (singleton 5 ++ singleton 6) [7, 8]+            ]) `shouldBe` [1..8 :: Int]  data DummyException = DummyException     deriving (Show, Typeable)