[darcs-devel] darcs patch: make Hopefully have type witnesses
Jason Dagit
dagit at codersbase.com
Fri Feb 15 19:12:13 UTC 2008
On Fri, Feb 15, 2008 at 10:58 AM, David Roundy <droundy at darcs.net> wrote:
> On Fri, Feb 15, 2008 at 10:18:04AM -0800, Jason Dagit wrote:
> > Sun Feb 10 01:00:34 PST 2008 Jason Dagit <dagit at codersbase.com>
> > * make Hopefully have type witnesses
>
> Thanks! This looks good, but I've got one question...
>
> > \begin{code}
> > -get_common_and_uncommon :: RepoPatch p => (PatchSet p C(x),PatchSet p C(y)) ->
> > - ([PatchInfo],(RL (RL (PatchInfoAnd p)) :\/: RL (RL (PatchInfoAnd p))) C(x y))
> > -get_common_and_uncommon_or_missing :: RepoPatch p => (PatchSet p C(x),PatchSet p C(y)) ->
> > - Either PatchInfo ([PatchInfo],(RL (RL (PatchInfoAnd p)) :\/: RL (RL (PatchInfoAnd p))) C(x y))
> > +get_common_and_uncommon :: (RepoPatch p, (Invert (PatchInfoAnd p)))
> > + => (PatchSet p C(x),PatchSet p C(y))
> > + -> ([PatchInfo],(RL (RL (PatchInfoAnd p)) :\/: RL (RL (PatchInfoAnd p))) C(x y))
> > +get_common_and_uncommon_or_missing :: (RepoPatch p, (Invert (PatchInfoAnd p)))
> > + => (PatchSet p C(x),PatchSet p C(y))
> > + -> Either PatchInfo ([PatchInfo],(RL (RL (PatchInfoAnd p)) :\/: RL (RL (PatchInfoAnd p))) C(x y))
>
> Why is this Invert instance required here? It seems to me like the compiler
> ought to be able to infer from RepoPatch p that (Invert (PatchInfoAnd
> p))...
>
> I haven't actually looked into why this instance isn't inferred, since I
> thought I'd run it by you first.
I actually don't know either. I did have to change some instances in
HopefullyPrivate.lhs. Maybe doing so in there requires that I change
the instance of RepoPatch.
>From the sounds of it, RepoPatch is intended to take care of this
Invert instance? I'll look at fixing that.
Jason
More information about the darcs-devel
mailing list