Thanks everyone. The first suggestion did the trick without needing any other modules.
data Task = Task { name :: String, desc :: String, dur :: Days } -- tasks is a list of these and deps is a list of...
data Dep = Dep { pre :: String, post :: String } -- referring to Task's name
-- draw the squiggles representing sequential dependencies:
beziset = foldl atop mempty $ map ((maybe mempty id).bezis) deps
bezis (Dep bef aft) =
findIndex (\t-> name t == bef) tasks >>= \bti ->
findIndex (\t-> name t == aft) tasks >>= \ati ->
let t1 = fromIntegral bti in
let d1 = finish (tasks !! bti) in --finish is begin + duration
let t2 = fromIntegral ati in
let d2 = begin (tasks !! ati) in --begin is the latest of the end dates of the directly preceding tasks (or project kickoff)
return ( -- the following monstrosity is just about my coordinate system
fromSegments [bezier3 (r2 (1.3,0)) (r2 (d2-d1-1,-(t2-t1)*(1+gap))) (r2 (d2-d1,-(t2-t1)*(1+gap))) ] #
translate (r2 (descspace+d1,-t1*(1+gap))) )
beziset then gets `atop`ed onto a Diagram.
bezis looks far too long as well. Any way to tidy it up? (For some perverse reason I still don't like do notation.) (I know the bezier3 expression is hideous but I can fix that myself.)
Adrian.
PS: In my previous job I once spent a week evaluating gantt chart drawing softwares. Now I wrote the one I was looking for in half a day. That's Haskell!