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
It'd be handy to have something like foldMapWithKey so you can do:
constreplaceAll=foldMapWithKey(Endo)(k=>v=>s=>s.replace(k,v))constf=replaceAll({"Earth": "Jupiter","Mars": "Earth"})f("Come in Earth, this is Mars speaking")// => "Come in Jupiter, this is Earth speaking"
Similarly traverseWithKey.
The text was updated successfully, but these errors were encountered:
I'm actually still a little bit torn about whether it's a better idea to have foldMapWithKey and traverseWithKey or just: type WithKey k f = { withKey : f a -> f (k, a) }. If you do it the second way you can implement traverseWithKey just once for anything that happens to be both Traversable and WithKey (although of course you have to implement withKey for everything).
It'd be handy to have something like
foldMapWithKey
so you can do:Similarly
traverseWithKey
.The text was updated successfully, but these errors were encountered: