Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $> instead of *> and pure where possible #189

Merged
merged 1 commit into from
Sep 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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