Re: [Haskell] RFC: DData in hierarchical libraries

JP Bernardy wrote:
Could you be more specific about this?
Oops, shall I supply documentation text?
Would you prefix the function name with unsafe? I wonder what is the best way to do such a marking.
No, I only suggest(ed) to change the documentation, may to "unsafe coercions of ordered lists". (The name "formDistinctAscList" is compelling enough)
Furthermore, already for Set.fromList I expect it to be linear, if the input list happens to be ascending.
I'm afraid it's not, unfortunately. I intend not to fiddle with the implementation, to avoid the involved instability.
Well, no problem, only my wrong assumption (and an argument to use "unsafe" functions for efficiency), don't change the implementation.
I'd choose "mapMonotonic", from Edison.
Maybe the infix (or suffix) "Asc" could uniformly indicate the unsafe nature of a functions. So delete toAscList and have fromAscList and mapAsc as unsafe versions of fromList and map resp. (forget Set.image) Christian
participants (1)
-
Christian Maeder