[darcs-users] index format

Petr Rockai me at mornfall.net
Mon Jun 8 18:28:46 UTC 2009


Jason Dagit <dagit at codersbase.com> writes:

> Petr, yes the number of implicit invariants in darcs is part of why it can be
> hard to hack on darcs.  I'm advocating fewer of these, but the use of undefined
> /somevalue instead Nothing/Just adds one more implicit thing to keep track of.
>  We also have plenty of elegant ways to deal with functions that return Maybe.
There really aren't any elegant ways to deal with Maybe. And for goodness sake,
it's not like any code outside of Index is ever going to see that undefined...

> On the other hand, combine this preference for undefined/error with the push to
> release this code with minimal internal testing makes me quite afraid of the
> next release.
When was the last time any internal testing ensured any reasonable release
quality when it comes to darcs?

> I don't mean to sound like a jerk, but what your suggesting is a huge turn off
> for me as a darcs user.
See, this is totally read only as far as your repositories are
concerned. Moreover, this is becoming pointless quickly, diverting precious
time that could be spent improving the code into bikeshedding.

> Also, as Eric points out, the problem doesn't have to be about Maybe.  There
> are other ways to deal with this that do not involve Maybe.
This is just about making an alias ...

    foo1 x y z = unsafeFoo x y (Just z)
    foo2 x y = unsafeFoo x y Nothing

just inventing extra naming and adding to bloat (or am I missing something?).

When an actual useful refactor is suggested that would remove that undefined
bit, sure why not. But nothing so far suggested would actually improve safety
or code quality in any appreciable way. Just a waste of time. If you want to
see what happens if you tread error handling code through nearly every function
of a module, see Darcs.SlurpDirectory.Internal. I don't intend to repeat that
mistake (moreover reading boilerplate makes me sick... and I tend to read my
own code quite a bit).

-- Peter.

PS: If it would comfort you in any way, Index is likely the most arcane and
convoluted part of the hashed-storage code. Also, hashed-storage is intended to
replace the SlurpDirectory code, which is full of unsafe IO interleaving with
obscure side effects that no-one quite understands. Moreover, the code is plain
unreadable and largely undocumented.

-- 
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


More information about the darcs-users mailing list