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
2828traverseOf
2929 :: forall f s t a b . (Applicative f )
3030 => 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
3232
3333-- | Sequence the foci of a `Traversal`, pulling out an `Applicative` effect.
3434-- | If you do not need the result, see `sequenceOf_` for `Fold`s.
3535sequenceOf
3636 :: forall f s t a . (Applicative f )
3737 => 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
3939
4040-- | Tries to map over a `Traversal`; returns `empty`, if the traversal did
4141-- | not have any new focus.
4242failover
4343 :: forall f s t a b . (Alternative f )
4444 => 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
4646 Tuple (Disj true ) x -> pure x
4747 Tuple (Disj false ) _ -> empty
You can’t perform that action at this time.
0 commit comments