Skip to content

Commit 553a0dc

Browse files
committed
Use left/right
1 parent e18bc5c commit 553a0dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Data/Lens/Prism/Either.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ module Data.Lens.Prism.Either where
22

33
import Prelude
44

5-
import Data.Either (Either(..), either)
6-
5+
import Data.Either (Either(..))
76
import Data.Lens.Prism (Prism(), prism)
7+
import Data.Profunctor.Choice (left, right)
88

99
-- | Prism for the `Left` constructor of `Either`.
1010
_Left :: forall a b c. Prism (Either a c) (Either b c) a b
11-
_Left = prism Left $ either Right (Left <<< Right)
11+
_Left = left
1212

1313
-- | Prism for the `Right` constructor of `Either`.
1414
_Right :: forall a b c. Prism (Either c a) (Either c b) a b
15-
_Right = prism Right $ either (Left <<< Left) Right
15+
_Right = right

0 commit comments

Comments
 (0)