List module in library report exports []((:), [])
Ian Lynagh
igloo@earth.li
Mon, 26 Nov 2001 18:22:41 +0000
Hiyas
A few more things I'm afraid :-(
The List module in the library report exports []((:), []) which, as I
mentioned in a previous thread WRT the GHC prelude, the report doesn't
allow in the exports list.
The block at the top listing the exports and types has been split into 2
at an apparently arbitrary point for no obvious reason?
deleteFirstsBy has no corresponding deleteFirsts and is not mentioned in
the text. Actually, having looked at the definitions it seems to be what
we would like to call \\By, so this should be noted in the "By" section.
insert and the zip/unzip stuff is also not explained in the text - don't
know if this is deliberate or not (insert is also mentioned with sort).
sortBy is mentioned before the "By" section unlike the other By variants
for no obvious reason.
"exmaple"
genericIndex seems to be a generic !!, but
The prefix "generic" indicates an overloaded function that is a
generalised version of a Prelude function.
and index is something completely different and defined in Ix. Clearly
the function can't be called generic!!, so I suggest the non-uniformity
be noted.
I am also curious as to why other functions don't have generic
equivalents, e.g. elemIndex, findIndices - is it because they were also
not considered important enough (as per the By functions)?
The indentation of unfoldr, maximumBy and minimumBy seems to have gone
wrong with some things not being indented at all (only looked at the
HTML version).
I think
unionBy eq xs ys = xs ++ foldl (flip (deleteBy eq)) (nubBy eq ys) xs
may be clearer written as
unionBy eq xs ys = xs ++ deleteFirstsBy eq (nubBy eq ys) xs
Thanks
Ian