packages feed

universum 1.3.0 → 1.4.0

raw patch · 10 files changed

+38/−77 lines, 10 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Universum.Exception: mask_ :: MonadMask m => m a -> m a
- Universum.Function: identity :: a -> a
- Universum.Lifted.Env: getArgs :: MonadIO m => m [String]
- Universum.Lifted.File: getContents :: MonadIO m => m Text
- Universum.Lifted.File: interact :: MonadIO m => (Text -> Text) -> m ()
- Universum.Lifted.ST: stToIO :: MonadIO m => ST RealWorld a -> m a
- Universum.List.Safe: list :: [b] -> (a -> b) -> [a] -> [b]

Files

CHANGES.md view
@@ -1,3 +1,32 @@+1.4.0+=====+* [#167](https://github.com/serokell/universum/issues/164):+  `identity` has been removed.++  _Migration guide:_ use `Universum.id` instead.+* [#177](https://github.com/serokell/universum/issues/177):+  The `mask_` reexport from `safe-exceptions` has been removed.++  _Migration_guide:_ use `Control.Exception.Safe.mask_` from `safe-exceptions`+  instead.+* [#178](https://github.com/serokell/universum/issues/178):+  `getArgs` has been removed.++  _Migration guide:_ use `liftIO` directly with `System.Environment.getArgs`+  from base.+* [#179](https://github.com/serokell/universum/issues/179):+  `getContents` and `interact` have been removed.++  _Migration guide:_ use `liftIO` directly with `Data.Text.Lazy.IO.getContents`+  and `Data.Text.Lazy.IO.interact`, both from the `text` package.+* [#180](https://github.com/serokell/universum/issues/180):+  The `Lifted.ST` module has been removed.+  +  _Migration guide:_ use `liftIO` directly with functions from+  `Control.Monad.ST` instead.+* [#181](https://github.com/serokell/universum/issues/181):+  `list` has removed.+ 1.3.0 ===== @@ -41,7 +70,7 @@ * [#159](https://github.com/serokell/universum/issues/159) **Breaking change**:   Remove `text-format` dependency. -  _Migration guide:_ import `Buildable` type class either from `text-format` or `formatting` or `fmt` library. Instead of `pretty` you can use [`fmt`](https://hackage.haskell.org/package/fmt-0.6/docs/Fmt.html#v:fmt) function.+  _Migration guide:_ import `Buildable` type class either from `text-format` or `formatting` or `fmt` library. There is no direct replacement for `pretty` and `prettyL` in popular libraries. You can define `prettyL = Data.Text.Lazy.Builder.toLazyText . build` and `pretty = Data.Text.Lazy.toStrict` . prettyL`. * [#164](https://github.com/serokell/universum/issues/164):   Don't reexport `log :: Floating a => a -> a`. 
README.md view
@@ -2,7 +2,7 @@ =========  [![Build Status](https://travis-ci.org/serokell/universum.svg?branch=master)](https://travis-ci.org/serokell/universum)-[![Windows build status](https://ci.appveyor.com/api/projects/status/github/serokell/universum?branch=master&svg=true)](https://ci.appveyor.com/project/ChShersh/universum)+[![Windows build status](https://ci.appveyor.com/api/projects/status/github/serokell/universum?branch=master&svg=true)](https://ci.appveyor.com/project/gromakovsky/universum) [![Hackage](https://img.shields.io/hackage/v/universum.svg)](https://hackage.haskell.org/package/universum) [![Stackage LTS](http://stackage.org/package/universum/badge/lts)](http://stackage.org/lts/package/universum) [![Stackage Nightly](http://stackage.org/package/universum/badge/nightly)](http://stackage.org/nightly/package/universum)@@ -90,8 +90,8 @@  1. Not trying to be as general as possible (thus we don't export much from    [`GHC.Generics`](https://github.com/sdiehl/protolude/blob/41710698eedc66fb0bfc5623d3c3a672421fbab5/src/Protolude.hs#L365)).-2. Not trying to maintain every version of `ghc` compiler (only the-   [latest 3](https://github.com/serokell/universum/blob/b6353285859e9ed3544bddbf55d70237330ad64a/.travis.yml#L15)+2. Not trying to maintain every version of `ghc` compiler (but [at least the+   latest 3](https://github.com/serokell/universum/blob/b6353285859e9ed3544bddbf55d70237330ad64a/.travis.yml#L15)). 3. Trying to make writing production code easier (see    [enhancements and fixes](https://github.com/serokell/universum/issues)). @@ -357,3 +357,4 @@ | [orgstat](https://github.com/volhovm/orgstat) | | [tintin](https://github.com/theam/tintin) | | [require](https://theam.github.io/require/) |+| [ariadne](https://github.com/serokell/ariadne) |
src/Universum/Exception.hs view
@@ -15,7 +15,6 @@        , pattern Exc #endif        , note-       , mask_        ) where  -- exceptions from safe-exceptions@@ -23,7 +22,6 @@                                SomeException (..), bracket, bracketOnError, bracket_, catch,                                catchAny, displayException, finally, handleAny, onException,                                throwM, try, tryAny)-import qualified Control.Exception.Safe as Safe (mask_) import Control.Monad.Except (MonadError, throwError) import Universum.Applicative (Applicative (pure)) import Universum.Monad (Maybe (..), maybe)@@ -49,10 +47,6 @@ bug :: (HasCallStack, Exception e) => e -> a bug e = Safe.impureThrow (Bug (Safe.toException e) callStack) #endif--mask_ :: MonadMask m => m a -> m a-mask_ = Safe.mask_-{-# DEPRECATED mask_ "This function will be removed in a future version of this package, use `Control.Exception.Safe.mask_` from `safe-exceptions` instead." #-}  -- To suppress redundant applicative constraint warning on GHC 8.0 -- | Throws error for 'Maybe' if 'Data.Maybe.Nothing' is given.
src/Universum/Function.hs view
@@ -2,13 +2,6 @@  module Universum.Function        ( module Data.Function-       , identity        ) where  import Data.Function (const, fix, flip, id, on, ($), (.))---- | Renamed version of 'Prelude.id'.-identity :: a -> a-identity = id-{-# INLINE identity #-}-{-# DEPRECATED identity "Use `id` instead" #-}
src/Universum/Lifted.hs view
@@ -7,11 +7,9 @@        , module Universum.Lifted.Env        , module Universum.Lifted.File        , module Universum.Lifted.IORef-       , module Universum.Lifted.ST        ) where  import Universum.Lifted.Concurrent import Universum.Lifted.Env import Universum.Lifted.File import Universum.Lifted.IORef-import Universum.Lifted.ST
src/Universum/Lifted/Env.hs view
@@ -3,8 +3,7 @@ -- | Lifted versions of functions that work with environment.  module Universum.Lifted.Env-       ( getArgs-       , exitWith+       ( exitWith        , exitFailure        , exitSuccess        , die@@ -16,15 +15,8 @@ import System.Exit (ExitCode) import System.IO (stderr) -import qualified System.Environment as XIO import qualified System.Exit as XIO import qualified System.IO (hPutStrLn)---- | Lifted version of 'System.Environment.getArgs'.-getArgs :: MonadIO m => m [String]-getArgs = liftIO (XIO.getArgs)-{-# INLINE getArgs #-}-{-# DEPRECATED getArgs "This function will be removed in a future version of this package, use `liftIO` directly with `System.Environment.getArgs` from `base`." #-}  -- | Lifted version of 'System.Exit.exitWith'. exitWith :: MonadIO m => ExitCode -> m a
src/Universum/Lifted/File.hs view
@@ -6,9 +6,7 @@  module Universum.Lifted.File        ( appendFile-       , getContents        , getLine-       , interact        , openFile        , readFile        , writeFile@@ -20,8 +18,6 @@ import System.IO (Handle, IOMode)  import qualified Data.Text.IO as XIO-import qualified Data.Text.Lazy as L (Text)-import qualified Data.Text.Lazy.IO as LIO (getContents, interact) import qualified System.IO as XIO (openFile)  ----------------------------------------------------------------------------@@ -33,22 +29,10 @@ appendFile a b = liftIO (XIO.appendFile a b) {-# INLINE appendFile #-} --- | Lifted version of 'Data.Text.getContents'.-getContents :: MonadIO m => m L.Text-getContents = liftIO LIO.getContents-{-# INLINE getContents #-}-{-# DEPRECATED getContents "This function will be removed in a future version of this package, use `liftIO` with `Data.Text.Lazy.IO.getContents` from `text` instead." #-}- -- | Lifted version of 'Data.Text.getLine'. getLine :: MonadIO m => m Text getLine = liftIO XIO.getLine {-# INLINE getLine #-}---- | Lifted version of 'Data.Text.interact'.-interact :: MonadIO m => (L.Text -> L.Text) -> m ()-interact a = liftIO (LIO.interact a)-{-# INLINE interact #-}-{-# DEPRECATED interact "This function will be removed in a future version of this package, use `liftIO` with `Data.Text.Lazy.IO.interact` from `text` instead." #-}  -- | Lifted version of 'Data.Text.readFile'. readFile :: MonadIO m => FilePath -> m Text
− src/Universum/Lifted/ST.hs
@@ -1,14 +0,0 @@--- | This module contains lifted version of 'XIO.stToIO' function.--module Universum.Lifted.ST {-# DEPRECATED "This module will be removed in a future version of this package, use `liftIO` directly with functions from `Control.Monad.ST` instead." #-}-       ( stToIO-       ) where--import Control.Monad.Trans (MonadIO, liftIO)--import qualified Control.Monad.ST as XIO---- | Lifted version of 'XIO.stToIO'.-stToIO :: MonadIO m => XIO.ST XIO.RealWorld a -> m a-stToIO a = liftIO (XIO.stToIO a)-{-# INLINE stToIO #-}
src/Universum/List/Safe.hs view
@@ -4,8 +4,7 @@ -- | This module contains safe functions to work with list type (mostly with 'NonEmpty').  module Universum.List.Safe-       ( list-       , uncons+       ( uncons #if ( __GLASGOW_HASKELL__ >= 800 )        , whenNotNull        , whenNotNullM@@ -18,7 +17,6 @@ import Universum.Monad (Monad (..)) #endif -import Universum.Functor (fmap) import Universum.Monad (Maybe (..))  -- $setup@@ -28,19 +26,6 @@ -- >>> import Universum.Container (length) -- >>> import Universum.Function (($)) -- >>> import Universum.Print (print)---- | Returns default list if given list is empty.--- Otherwise applies given function to every element.------ >>> list [True] even []--- [True]--- >>> list [True] even [1..5]--- [False,True,False,True,False]-list :: [b] -> (a -> b) -> [a] -> [b]-list def f xs = case xs of-    [] -> def-    _  -> fmap f xs-{-# DEPRECATED list "This function will be removed in a future version of this package, do not use it." #-}  -- | Destructuring list into its head and tail if possible. This function is total. --
universum.cabal view
@@ -1,5 +1,5 @@ name:                universum-version:             1.3.0+version:             1.4.0 synopsis:            Custom prelude used in Serokell description:         See README.md file for more details. homepage:            https://github.com/serokell/universum@@ -16,7 +16,7 @@ tested-with:         GHC == 7.10.3                    , GHC == 8.0.2                    , GHC == 8.2.2-                   , GHC == 8.4.2+                   , GHC == 8.4.3 extra-doc-files:     CHANGES.md                    , CONTRIBUTING.md                    , README.md@@ -49,7 +49,6 @@                                Universum.Lifted.Env                                Universum.Lifted.File                                Universum.Lifted.IORef-                               Universum.Lifted.ST                            Universum.List                                Universum.List.Reexport                                Universum.List.Safe