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
Note the lack of Ord constraints: these functions are unsafe in that it's the user's responsibility to make sure the k and b values agree on their ordering, just as it is for mapMonotonic. I think those are reasonable functions to add, but a little bit out of scope of that issue, hence this one.
The text was updated successfully, but these errors were encountered:
that can then be composed with other ones to generate all the variants?
unsafeToSet:: (k->a->b) ->Mapka->Setb
unsafeToSet f =Set.mapMonotonic (\(Arg k a) -> f k a) . toSet
unsafeToMap:: (b-> (k, a)) ->Setb->Mapka
unsafeToMap f = toMap .Set.mapMonotonic (uncurryArg. f)
This isomorphism might also be useful elsewhere actually
Oh nevermind, you already stated all that in #814 (comment) .
I thought containers avoided functions that were easily derivable from already exposed ones (unless a specialized version was more efficient) to keep the API small?
In #814, @treeowl asked for functions like these:
And also ones that live in an
Applicative
, which I assume means ones like these:Note the lack of
Ord
constraints: these functions are unsafe in that it's the user's responsibility to make sure thek
andb
values agree on their ordering, just as it is formapMonotonic
. I think those are reasonable functions to add, but a little bit out of scope of that issue, hence this one.The text was updated successfully, but these errors were encountered: