Jason Dagit <[email protected]> writes: > My recommendation is to make that field hold a Maybe instead of the raw > value. I can see myself, or someone else, not understanding this invariant > and 'accidentally' using that slot when it is undefined. If you instead use > Maybe then it is much easier to see how to use this safely. Your description > above makes me quite concerned about the robustness of the code.
It also makes it harder to read other code -- it becomes either unsafe (using fromJust) or littered with useless conditionals. Moreover, there are zillions of things that are implicit in darcs, often much more involved and less documented (think just about exceptions versus Slurpy, leading to a bug that has been very hard to track down). I think that adding documentation to the few relevant places is adequate. Plus flipping undefined to error with unique message will make any bugs involving this "unsafeness" trivial to track down. Yours, Petr. -- Peter Rockai | me()mornfall!net | prockai()redhat!com http://blog.mornfall.net | http://web.mornfall.net "In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." -- Blair P. Houghton on the subject of C program indentation _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
