We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e18bc5c commit 553a0dcCopy full SHA for 553a0dc
src/Data/Lens/Prism/Either.purs
@@ -2,14 +2,14 @@ module Data.Lens.Prism.Either where
2
3
import Prelude
4
5
-import Data.Either (Either(..), either)
6
-
+import Data.Either (Either(..))
7
import Data.Lens.Prism (Prism(), prism)
+import Data.Profunctor.Choice (left, right)
8
9
-- | Prism for the `Left` constructor of `Either`.
10
_Left :: forall a b c. Prism (Either a c) (Either b c) a b
11
-_Left = prism Left $ either Right (Left <<< Right)
+_Left = left
12
13
-- | Prism for the `Right` constructor of `Either`.
14
_Right :: forall a b c. Prism (Either c a) (Either c b) a b
15
-_Right = prism Right $ either (Left <<< Left) Right
+_Right = right
0 commit comments