Skip to content

Commit

Permalink
Optimize *> by using stimes
Browse files Browse the repository at this point in the history
  • Loading branch information
konsumlamm committed Jun 18, 2024
1 parent ce10b48 commit 9b1f048
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/RRBVector/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ instance Applicative Vector where
pure = singleton
fs <*> xs = foldl' (\acc f -> acc >< map f xs) empty fs
liftA2 f xs ys = foldl' (\acc x -> acc >< map (f x) ys) empty xs
xs *> ys = foldl' (\acc _ -> acc >< ys) empty xs
xs *> ys = stimes (length xs) ys
xs <* ys = foldl' (\acc x -> acc >< replicate (length ys) x) empty xs

instance Monad Vector where
Expand Down

0 comments on commit 9b1f048

Please sign in to comment.