Skip to content

Commit

Permalink
[#244] Remove DEPRECATED 'prec', 'dupe', 'mapBoth'
Browse files Browse the repository at this point in the history
Resolves #244
  • Loading branch information
vrom911 committed May 11, 2020
1 parent 68ad5d2 commit 5a8f7ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ The changelog is available [on GitHub][2].
(by [@mxstrbng](https://github.com/mstruebing))
* [#233](https://github.com/kowainik/relude/issues/233):
Add `etaReaderT` to `Relude.Monad.Trans` to help with performance.
* [#244](https://github.com/kowainik/relude/issues/244):
Remove deprecated functions: `prec`, `dupe` and `mapBoth`.

__Migration rules:__
+ `prec`: use `prev` instead
+ `dupe`: use `dup` instead
+ `mapBoth`: use `bimapBoth` instead

## 0.6.0.0 — Oct 30, 2019

Expand Down
6 changes: 0 additions & 6 deletions src/Relude/Extra/Enum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module Relude.Extra.Enum
, inverseMap
, next
, prev
, prec
, safeToEnum
) where

Expand Down Expand Up @@ -129,11 +128,6 @@ prev e
| otherwise = pred e
{-# INLINE prev #-}

-- | See 'prev'.
prec :: (Eq a, Bounded a, Enum a) => a -> a
prec = prev
{-# DEPRECATED prec "Use 'prev' instead, it has more idiomatic and common name" #-}

{- | Returns 'Nothing' if given 'Int' outside range.
>>> safeToEnum @Bool 0
Expand Down
17 changes: 0 additions & 17 deletions src/Relude/Extra/Tuple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ Contains utility functions for working with tuples.

module Relude.Extra.Tuple
( dup
, dupe
, mapToFst
, mapToSnd
, mapBoth
, traverseToFst
, traverseToSnd
, traverseBoth
Expand All @@ -38,11 +36,6 @@ dup :: a -> (a, a)
dup a = (a, a)
{-# INLINE dup #-}

-- | See 'dup'.
dupe :: a -> (a, a)
dupe = dup
{-# DEPRECATED dupe "Use 'dup' instead, it has more idiomatic and common name" #-}

{- | Apply a function, with the result in the fst slot,
and the value in the other.
Expand All @@ -67,16 +60,6 @@ mapToSnd :: (a -> b) -> a -> (a, b)
mapToSnd f a = (a, f a)
{-# INLINE mapToSnd #-}

{- | Maps a function over both elements of a tuple.
>>> mapBoth ("Hello " <>) ("Alice", "Bob")
("Hello Alice","Hello Bob")
-}
mapBoth :: (a -> b) -> (a, a) -> (b, b)
mapBoth f (a1, a2) = (f a1, f a2)
{-# DEPRECATED mapBoth "Use 'Relude.Extra.Bifunctor.bimapBoth' from \"Relude.Extra.Bifunctor\" instead" #-}
{-# INLINE mapBoth #-}

{- | Apply a function that returns a value inside of a functor,
with the output in the first slot, the input in the second,
and the entire tuple inside the functor.
Expand Down

0 comments on commit 5a8f7ed

Please sign in to comment.