You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a good point. I think it's quite related to the discussion on #447 , isn't it? It's all about “what are natural things we can do with linear values”. The more we ask of Consumable, Dupable, etc… the less natural the function is.
Just like for sorting and stuff, dropWhile seems to want to know something about a without consuming a (or consuming a only in some cases). And it does all feel kind of icky in the world of linear types.
I have the feeling at the back of my head that, yes, there is some good principle that would cover a lot of theses cases. But I don't know. Of course, anything that changes the size of a list is going to have some amount of unnaturalness. But can we minimise? mapWhileJust is clearly an improvement.
We have
Should we add a version that (a bit like
mapMaybe
forfilter
) relaxes the constraint while adding flexibility?Unfortunately, I don't see any similarly intuitive analogue of
dropWhile
.The text was updated successfully, but these errors were encountered: