>> * move tryShrinkingInverse to D.P.Invert, rename to dropInverses
>
> Fine. 'dropInitialInverses' might be a better name for this.
(I was thinking that "drop" implies the "initial" part, by association
with the "drop" function on lists.)
>> * add class PrimSift so we can avoid using PrimConstruct and
> PrimClassify in Pending
>
> I assume this is just a reorganisation of the code, no functionality
> changes? I haven't checked that line by line.
Yes, exactly, copy & paste ;-)
> Why aren't the 'defaultV1' functions just placed directly in the V1
> implementation?
Because they do not depend on Prim.V1, at least not directly. They only
use PrimClassify and PrimCanonize which are nominally not specific to
Prim.V1 (though in practice they are pretty much tied to it). The
functions are used to implement PrimSift for V2.Prim as well as V1.Prim,
both of which are Prim.V1 in disguise, so perhaps it might make sense to
define an instance for Prim.V1 directly and derive the instances for
V1.Prim and V2.Prim. (Originally I wanted these definitions to be
default implementations of the methods but that failed miserably with
numerous typing problems.)
The names of the functions are ugly and I think that's how it should be,
given that this is not an API that was properly designed and there is no
specification for them. In fact, the way isSimple and crudeSift are used
in D.R.Pending is merely for optimization. And this sort of optimization
is really bad because it obscures the code considerably and buys us
almost nothing, since pending is normally rather small. In my later
refactorings of D.R.Pending I have dropped their use, so that only
siftForPending remains. Cleaning up its implementation and perhaps
giving it some sort of spec is left for future work.
|