Skip to content

Commit

Permalink
Make the Lift instance lazier (#63)
Browse files Browse the repository at this point in the history
* Make the Lift instance lazier

* Update changelog
  • Loading branch information
snowleopard authored Feb 18, 2023
1 parent b6699e8 commit 974b4a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.6

* Make the `Lift` instance lazier. See #63.
* Stop supporting GHC <= 8.6. See #62.
* Add `Control.Selective.Trans.Except` transformer. See #39.

Expand Down
2 changes: 1 addition & 1 deletion src/Control/Selective.hs
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ instance Applicative f => Selective (SelectA f) where

-- Note: Validation e a ~ Lift (Under e) a
instance Selective f => Selective (Lift f) where
select (Pure (Right x)) _ = Pure x -- Lazy in the second argument
select x (Pure y) = either y id <$> x
select (Pure (Right x)) _ = Pure x
select (Pure (Left x)) (Other y) = Other $ ($x) <$> y
select (Other x ) (Other y) = Other $ x <*? y

Expand Down

0 comments on commit 974b4a0

Please sign in to comment.