[darcs-users] darcs patch: Import cabalisation: Setup.lhs, darcs.ca... (and 13 more)

Jason Dagit dagit at codersbase.com
Sat Oct 18 20:04:02 UTC 2008

On Sat, Oct 18, 2008 at 12:37 PM, David Roundy <droundy at darcs.net> wrote:

> > Which is another problem I had.  Trying to understand what setup.hs does
> > has been difficult.  I had to read the entire source of Franchise twice
> > before I could figure out any part of what setup.hs is doing, and I still
> > don't know how to extend setup.hs.  The heavy use of operators and
> > redefined Haskell98 functions made the source hard for me to
> > read[1]. Only one module, Util.hs, seems to have any source level
> > documentation.  But, all that aside, the really hard to grok part is the
> > undocumented mutually recursive datastructures that sit at the heart of
> > franchise.  Unfortunately, as a user of setup.hs you need to understand
> > them because they are exposed at that level currently.  I forget what the
> > types are called but it's the ones that use (:<), (:<-), and (|<-) as
> > constructors.  You can see them at use in setup.hs.  The impression given
> > there is that they hide some sort of magic.
> For almost all uses, you don't need to understand the dependency and make
> rules, and I'll welcome suggestions for improvements (preferably to the
> franchise mailing list).

I have no idea where that is, so I'll just continue here.  My first advice
would be to either heavily justify the need for mutually recursive data
structures and document them accordingly or avoid them.  They put
considerable cognitive load on developers, so if they aren't necessary let's
try to simplify a bit.

>  :< is the equivalent of ':' in a makefile,
> separating a target from its dependencies, and :<- and |<- are both the
> something like a tab, in that they connect a target-dependency relationship
> with a rule for building the target from its dependencies.

Wouldn't it be simpler to use a familiar data structure such as a graph?
The talk Duncan gave about Cabal touched on the (somewhat well known) idea
that make is based on graphs of dependencies:
Although I don't know how much the slides talk about it.

> > [1] endsWith/beginsWith/startsWith all seem to be equivalent to functions
> > found in the Haskell98 report.  By giving new definitions of these
> functions
> > I was tricked into reading their definitions and trying to understand
> *how*
> > they differ in behavior from the isSuffixOf and isPrefixOf.  I have
> patches
> > that replace the home grown versions with the ones from Data.List if
> anyone
> > wants them.
> You are welcome to send patches in, but patches that add new dependencies
> won't be accepted.  I avoided using Data.List because I didn't know if it
> was likely to be moved out of base.  And one of the points of franchise is
> to be portable from one version of ghc to another.

Attached.  No new dependencies were added.  Franchise is already using
Data.List, but if you don't like the patches, I don't need to know about it
as I won't be amending them.  I only created them to help me understand

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osuosl.org/pipermail/darcs-users/attachments/20081018/84551cfe/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-haskell98-list-functions.dpatch
Type: text/x-darcs-patch
Size: 8226 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20081018/84551cfe/attachment.bin 

More information about the darcs-users mailing list