fp-ts-std
fp-ts-std copied to clipboard
Apply many Alternative functions
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
Foldabletoo?