[darcs-users] darcs patch: Add more type witnesses

David Roundy droundy at darcs.net
Tue Aug 5 16:36:52 UTC 2008


On Tue, Aug 05, 2008 at 08:01:30AM -0700, Jason Dagit wrote:
> This is a resend that should fix the conflicting edits we have in 
> src/Darcs/Match.lhs.
> 
> Still not finished, but it should be easier for you to play with
> than the previous patch.


> hunk ./src/Darcs/Repository/Internal.lhs 701
> -withRepository :: [DarcsFlag] -> (forall p. RepoPatch p => Repository p -> IO a) -> IO a
> +withRepository :: forall a p. RepoPatch p => [DarcsFlag] -> (FORALL(r u t) Repository p C(r u t) -> IO a) -> IO a
>  withRepository opts1 = withRepositoryDirectory opts1 "."

Here's the main problem that keeps this from compiling without type
witnesses:  you've removed the second-rank polymorphism from
withRepository and friends, which breaks these functions (this and
withRepoLock).  This function needs to be

withRepository :: [DarcsFlag]
               -> (forall p C(r u t). RepoPatch p => Repository p C(r u t) -> IO a)
               -> IO a

but this won't compile without other changes.

I haven't yet looked at the other changes.  (The one that broke the
compile was first priority!)

David


More information about the darcs-users mailing list