Jason Dagit <[email protected]> writes:
> I take it that you've defined (?) with the type:
> (?) :: Bool -> (a, a) -> a
Yes.

> Is the above real code or pseudo code?
Real code.

> The use of 'undefined' and explicitly checking for '/' seem like potential
> bugs waiting to happen.
The only place where dirlen is Nothing is when peekItem is called from
createItem. In this case, iName is never used, so the code is safe. Both
createItem and peekItem are supposed to be private in the Index module. (I'll
add a remark that they are unsafe and I'll add explicit export list to the
module).

> Using fromJust seems equally risky, and I see that you guard it and then use
> undefined.  Why do you prefer undefined over a fromJust failure?  In
> particular, the fromJust that darcs provides gives you line number
> information becase it is implemented as a CPP macro.
Ok. I guess "error" would be even more appropriate here. I don't think that
propagating the maybe-ness further makes much sense, since the use pattern for
iName is determined statically. It would just be inconvenient to describe that
in the type system, so it's not.

> Also, do you provide justification for your constants?  eg., 4, 8, 64.  Would
> those constants change on other platforms?
64 = length of sha256 as hex string
4 = length of Int32
8 = length of Int64

These are all platform-independent.

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

Reply via email to