-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer safe variants for the RIO.List.Partial functions in the RIO.List module #82
Comments
In principle: I'm OK with this approach. I'm not convinced that |
That is fair, honestly, my intent was not to strongly advocate names, may I create a pull request and we revisit the names as we go? |
FYI: |
Implemented in #96 |
Late entry, but perhaps relevant... yesterday I had to switch some lists over to vectors so I could use defaulting :: Foldable f => b -> (f a -> b) -> f a -> b
defaulting d f xs
| null xs = d
| otherwise = f xs So now I have e.g. mayhap :: Foldable f => (f a -> b) -> f a -> Maybe b
mayhap f = defaulting Nothing (Just . f) Are there any particular downsides to this technique? It seems far more elegant than a slew of specialized, type-specific functions. |
Iterating over the work from #43, what do you think about adding all the functions from
RIO.List.Partial
with asafe
prefix in theRIO.List
module?There is no clear replacement for the functions in
RIO.List.Partial
, and I would avoid them as much as possible if I can.The text was updated successfully, but these errors were encountered: