Skip to content

Commit

Permalink
Use $> instead of *> and pure where possible (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible authored and vrom911 committed Sep 21, 2019
1 parent aaf97de commit 0685ea3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The changelog is available [on GitHub][2].

## Unreleased: 0.6.0.0

* Use `$>` instead of `*>` and `pure` where possible.
* [#167](https://github.com/kowainik/relude/issues/167):
Rename functions `prec`/`prev`, `dupe`/`dup`.
* [#155](https://github.com/kowainik/relude/issues/155):
Expand Down
2 changes: 1 addition & 1 deletion src/Relude/Extra/Enum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ Nothing
Nothing
-}
safeToEnum :: forall a . (Bounded a, Enum a) => Int -> Maybe a
safeToEnum i = guard (fromEnum @a minBound <= i && i <= fromEnum @a maxBound) *> Just (toEnum i)
safeToEnum i = guard (fromEnum @a minBound <= i && i <= fromEnum @a maxBound) $> toEnum i
{-# INLINE safeToEnum #-}
8 changes: 4 additions & 4 deletions src/Relude/Extra/Map.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ module Relude.Extra.Map

import GHC.Exts (IsList (Item, toList))

import Relude.Applicative (pure, (*>))
import Relude.Base (Eq, Ord, Type)
import Relude.Bool (Bool, guard, not)
import Relude.Container.Reexport (HashMap, HashSet, Hashable, IntMap, IntSet, Map, Set, fst, snd)
import Relude.Function ((.))
import Relude.Functor.Reexport (($>))
import Relude.List (map)
import Relude.Monad.Reexport (Maybe (..), fromMaybe)
import Relude.Numeric (Int)
Expand Down Expand Up @@ -94,7 +94,7 @@ instance Ord a => StaticMap (Set a) where

size = S.size
member = S.member
lookup k m = guard (member k m) *> pure k
lookup k m = guard (member k m) $> k
{-# INLINE size #-}
{-# INLINE lookup #-}
{-# INLINE member #-}
Expand All @@ -105,7 +105,7 @@ instance (Eq a, Hashable a) => StaticMap (HashSet a) where

size = HS.size
member = HS.member
lookup k m = guard (member k m) *> pure k
lookup k m = guard (member k m) $> k
{-# INLINE size #-}
{-# INLINE lookup #-}
{-# INLINE member #-}
Expand All @@ -116,7 +116,7 @@ instance StaticMap IntSet where

size = IS.size
member = IS.member
lookup k m = guard (member k m) *> pure k
lookup k m = guard (member k m) $> k
{-# INLINE size #-}
{-# INLINE lookup #-}
{-# INLINE member #-}
Expand Down

0 comments on commit 0685ea3

Please sign in to comment.