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
importData.Set.InternaltraverseMonotonic::Applicativet=> (a->tb) ->Seta->t (Setb)
traverseMonotonic _ Tip=pureTip
traverseMonotonic f (Bin sz x l r) =flip (Bin sz) <$> traverseMonotonic f l <*> f x <*> traverseMonotonic f r
importData.Map.InternaltraverseKeysMonotonic::Applicativet=> (k1->tk2) ->Mapk1a->t (Mapk2a)
traverseKeysMonotonic _ Tip=pureTip
traverseKeysMonotonic f (Bin sz k x l r) = (\l' k' ->Bin sz k' x l') <$> traverseKeysMonotonic f l <*> f k <*> traverseKeysMonotonic f r
bitraverseMonotonic::Applicativet=> (k1->tk2) -> (v1->tv2) ->Mapk1v1->t (Mapk2v2)
bitraverseMonotonic _ _ Tip=pureTip
bitraverseMonotonic f g (Bin sz k x l r) = (\l' k' x' ->Bin sz k' x' l') <$> bitraverseMonotonic f g l <*> f k <*> g x <*> bitraverseMonotonic f g r
I think we should add these to Data.Set and Data.Map, respectively, as analogues of mapMonotonic, etc. Note that these are unsafe just like they are, and require the exact same care to avoid breaking invariants.
The text was updated successfully, but these errors were encountered:
If these are indeed good functions to add, then sure. (I just don't want to end up doing all the work of writing tests and documentation for them, and then find out we don't want them.)
I think we should add these to
Data.Set
andData.Map
, respectively, as analogues ofmapMonotonic
, etc. Note that these are unsafe just like they are, and require the exact same care to avoid breaking invariants.The text was updated successfully, but these errors were encountered: