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
I'm curious why there is no find function either in core or here in extras?
I literally checked both three times, because I thought it's just me being blind
Wouldn't that be a useful addition?
find: (a->Bool) ->Arraya->Maybea
Also it would be natural to have its findLast counterpart
Maybe even call find as findFirst for clarity?
The text was updated successfully, but these errors were encountered:
My guess is because it can only be implemented in core, as it requires native code if you wan't it to be fast. The only implementation you could get without native code, is filter pred >> get 0
But then why not expose the above implementation as find?
If you care about performance, you're on your own anyway. And if you don't care, you have a very convenient helper (and one people coming from other languages would probably expect to have). Implementation can then be improved at some later point
Hi!
I'm curious why there is no
find
function either in core or here in extras?I literally checked both three times, because I thought it's just me being blind
Wouldn't that be a useful addition?
Also it would be natural to have its
findLast
counterpartMaybe even call
find
asfindFirst
for clarity?The text was updated successfully, but these errors were encountered: