File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,20 +28,20 @@ traversed = wander traverse
28
28
traverseOf
29
29
:: forall f s t a b . (Applicative f )
30
30
=> Optic (Star f ) s t a b -> (a -> f b ) -> s -> f t
31
- traverseOf t f = runStar (t ( Star f))
31
+ traverseOf t = runStar <<< t <<< Star
32
32
33
33
-- | Sequence the foci of a `Traversal`, pulling out an `Applicative` effect.
34
34
-- | If you do not need the result, see `sequenceOf_` for `Fold`s.
35
35
sequenceOf
36
36
:: forall f s t a . (Applicative f )
37
37
=> Optic (Star f ) s t (f a ) a -> s -> f t
38
- sequenceOf t = runStar $ wander id $ t ( Star id)
38
+ sequenceOf t = traverseOf t id
39
39
40
40
-- | Tries to map over a `Traversal`; returns `empty`, if the traversal did
41
41
-- | not have any new focus.
42
42
failover
43
43
:: forall f s t a b . (Alternative f )
44
44
=> Optic (Star (Tuple (Disj Boolean ))) s t a b -> (a -> b ) -> s -> f t
45
- failover t f s = case runStar (wander id $ t $ Star $ Tuple (Disj true ) <<< f) s of
45
+ failover t f s = case runStar (t $ Star $ Tuple (Disj true ) <<< f) s of
46
46
Tuple (Disj true ) x -> pure x
47
47
Tuple (Disj false ) _ -> empty
You can’t perform that action at this time.
0 commit comments