On Sun, Aug 30, 2009 at 5:39 AM, Ganesh Sittampalam<[email protected]> wrote:
> I'm not 100% sure that the witnesses patch is a good idea, so would appreciate
> comment/discussion.
>
> Mon Aug 3 06:19:07 BST 2009 Ganesh Sittampalam <[email protected]>
> * remove unused export
>
> Mon Aug 3 06:24:57 BST 2009 Ganesh Sittampalam <[email protected]>
> * add type witnesses to Darcs.Diff
>
> This doesn't affect the internal safety at all, in the same way that
> construction of primitive patches is not safe. However together with the
> introduction of "witnessed slurpies" it does enable a "safe" interface to be
> exported.
I'm a natural person to look at this so I'm giving my thoughts/feedback.
It's similar in spirit to the RIO stuff that I still need to finish.
Therefore, I see it as a good thing.
I'm looking at this type and wondering how it works:
diff_at_path :: (Bool, Bool, Bool) -> (FilePath -> FileType)
- -> Slurpy -> Slurpy -> FilePath -> Maybe (FL Prim)
+ -> Slurpy -> Slurpy -> FilePath -> Maybe (FL Prim C(y
z) -> FL Prim C(x z))
How does it return a function that makes the sequence go from y to z
to x to z? Is it going to add or remove patches from the head of the
list? I would have guessed the type to be more like Maybe (FL Prim
C(x y) -> FL Prim C(x z)).
+invertQ :: (Invert p) => (FORALL(x y) p C(x y)) -> (FORALL(x y) p C(x y))
+invertQ p = invert p
I thought invert caused the context types to swap. So I would expect
this to be:
+invertQ :: (Invert p) => (FORALL(x y) p C(x y)) -> (FORALL(x y) p C(y x))
+newtype Witnessed t C(x) = Witnessed { unWitnessed :: t }
This type is potentially very abusable. In the past David has asked
that I not create types like this. The data constructor is inherently
unsafe in the presence of unsafeCoerceP. Will it be possible to hide
the data constructor in a module and only export constructors that
somehow constrain the phantom type?
Thanks,
Jason
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users