On Fri, Aug 15, 2008 at 7:38 AM, David Roundy <[EMAIL PROTECTED]> wrote:

> On Thu, Aug 14, 2008 at 10:43:33PM -0700, Jason Dagit wrote:
> > David,
> >
> > I don't think the last patch will compile with modules that use select
> > changes but I do think this version might be what you were expecting.  If
> > so I'll amend-record the last patch so that it compiles everywhere.
> >
> > Let me know what you think.
> >
> > Thanks,
> > Jason
> >
> > Tue Aug 12 20:16:25 PDT 2008  Jason Dagit <[EMAIL PROTECTED]>
> >   * major refactor of SelectChanges to work with type witnesses
> >
> > Tue Aug 12 22:04:25 PDT 2008  Jason Dagit <[EMAIL PROTECTED]>
> >   * refine type witnesses in SelectChanges
> >
> > Thu Aug 14 22:39:58 PDT 2008  Jason Dagit <[EMAIL PROTECTED]>
> >   * Potentially correct SelectChanges
>
> See below.  This is getting closer, but isn't quite right.  Good news
> is that I'm convinced that once it's right, you won't need
> unsafeCoerceP.  :)
>
> I believe there were also other similar select functions that I
> suggested you rewrite.  Those are still in the queue?


Sure, but I've invested all my waking time into this refactor for several
days.


>
>
> > hunk ./src/Darcs/SelectChanges.lhs 214
> > -wspfr :: RepoPatch p => String -> (PatchInfoAnd p -> Bool)
> > -      -> RL (PatchInfoAnd p) -> [PatchInfoAnd p]
> > -      -> IO (Maybe (PatchInfoAnd p, [PatchInfoAnd p]))
> > +wspfr :: RepoPatch p => String -> (FORALL(a b) (PatchInfoAnd p) C(a b)
> -> Bool)
> > +      -> RL (PatchInfoAnd p) C(x y) -> FL (PatchInfoAnd p) C(y z)
> > +      -> IO (Maybe (FlippedSeal (FL (PatchInfoAnd p) :> (PatchInfoAnd
> p)) C(z)))
>
> > [Potentially correct SelectChanges
> > Jason Dagit <[EMAIL PROTECTED]>**20080815053958] hunk
> ./src/Darcs/SelectChanges.lhs 48
> > -import Darcs.Patch.Ordered ( FL(..), RL(..), (:>)(..),
> > -                             (+>+), lengthFL, concatRL, mapFL_FL,
> > +import Darcs.Patch.Ordered ( FL(..), RL(..), (:>)(..), EqCheck(..),
> > +                             (+>+), lengthFL, concatRL, mapFL_FL,
> (=/\=),
> > hunk ./src/Darcs/SelectChanges.lhs 193
> > -with_selected_patch_from_repo :: RepoPatch p => String -> Repository p
> C(r u t) -> [DarcsFlag] -> Bool
> > -                              -> (FORALL(a b) ((FL (PatchInfoAnd p) :>
> (PatchInfoAnd p)) C(a b)) -> IO ()) -> IO ()
> > +with_selected_patch_from_repo :: forall p C(r u t). RepoPatch p =>
> String -> Repository p C(r u t) -> [DarcsFlag] -> Bool
> > +                              -> (FORALL(a b) ((FL (PatchInfoAnd p)) C(a
> r), ((PatchInfoAnd p) C(r b))) -> IO ()) -> IO ()
>
> No, this isn't quite right, and that's what's leading to your
> unsafeCoerceP below.  This should be:
>
> with_selected_patch_from_repo
>         :: forall p C(r u t). RepoPatch p => String
>         -> Repository p C(r u t) -> [DarcsFlag] -> Bool
>         -> (FORALL(a) ((FL (PatchInfoAnd p) :> PatchInfoAnd p) C(a r))) ->
> IO ()) -> IO ()
>
> which is to say that since we're selecting a patch from the repo, the
> final state had better be the recorded state.  With this type
> signature, the sloppyEquals shouldn't be required--which is to say,
> you should be able to use =/\= directly... you're completely right
> that an equality check is needed here.


In that case I'll try to stop refactoring the existing code and fix the
bug(s) that prevent it from having that type signature.

Jason
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to