File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ module Data.These (
14
14
, fromThese
15
15
, mergeThese
16
16
, mergeTheseWith
17
- , fromAlt
17
+ , optionally
18
18
19
19
-- * Traversals
20
20
, here , there
@@ -110,9 +110,10 @@ mergeThese = these id id
110
110
mergeTheseWith :: (a -> c ) -> (b -> c ) -> (c -> c -> c ) -> These a b -> c
111
111
mergeTheseWith f g op t = mergeThese op $ mapThese f g t
112
112
113
- -- | Construct These inside an Alternative.
114
- fromAlt :: Alternative f => f a -> f b -> f (These a b )
115
- fromAlt x y = These <$> x <*> y <|> That <$> y <|> This <$> x
113
+ -- | Construct These inside an Alternative.
114
+ -- Consider @Control.Applicative.optional` for intuition.
115
+ optionally :: Alternative f => f a -> f b -> f (These a b )
116
+ optionally x y = These <$> x <*> y <|> This <$> x <|> That <$> y
116
117
117
118
-- | A @Traversal@ of the first half of a 'These', suitable for use with @Control.Lens@.
118
119
here :: (Applicative f ) => (a -> f b ) -> These a t -> f (These b t )
You can’t perform that action at this time.
0 commit comments