On Sat, Nov 08, 2008 at 17:01:00 -0800, Jason Dagit wrote: > I did read your email though and I thought maybe the practice of > explaining the concepts would be good for everyone :)
It's especially good for the explainer! > When you seal away a value you agree to lose information about it. > Once you hide the value in a seal all you know about it is that it > exists. You could optionally add type class constraints to the data > constructor so that you know that it exists and it instances specific > type classes. You could use this trick to create heterogenous lists > of showable things: > data ShowableThing where > S :: Show a => a -> ShowableThing Hmm, so this is the existential in "phantom existential witness type" comes in. This was helpful, thanks. Maybe this time it'll sink in Maybe some minimal haddocks would be useful. In the meantime, I've preserved your (re)explanation on the wiki: http://wiki.darcs.net/index.html/DarcsInternals > We use these seals to control the way in which phantom types will > unify. Since phantoms have no value associated with them then in > principle when you construct the value that has a phantom type you can > make the phantom unify with any type. Ah, but if instead you seal the > phantom type then you have a way to make that phantom type distinct so > that it will not unify with arbitrary types. Using sealing to force non-unification... check! > I hope that helps, I think it does, thank-you (but don't be surprised if I come back into two months saying "argh! I didn't really understand that time either") -- Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow> PGP Key ID: 08AC04F9
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
