fp-ts-std icon indicating copy to clipboard operation
fp-ts-std copied to clipboard

Apply many Alternative functions

Open samhh opened this issue 3 years ago • 0 comments

firstGood :: Alternative m => [a -> m b] -> a -> m b
firstGood [] _     = empty
firstGood (f:gs) x = f x <|> firstGood gs x
  • Better naming
  • Presupply for Option
  • Does this really not already exist?
  • Test that it short-circuits
  • Generalise to Foldable too?

samhh avatar Jun 23 '22 11:06 samhh