[diagrams] #13: More combinators in D.Combinators

diagrams diagrams at projects.haskell.org
Fri Nov 26 18:56:17 EST 2010

#13: More combinators in D.Combinators
 Reporter:  byorgey  |       Owner:     
     Type:  task     |      Status:  new
 Priority:  major    |   Milestone:     
Component:  lib      |     Version:     
 Keywords:           |  
 Fill out the Combinators module with lots of combinators for putting
 diagrams together.  Use the original diagrams library for inspiration.
 However, I think we should use a record-passing style where each function
 takes a record of arguments, which has a default instance implemented via
 a Data.Default instance.  Then users get to do named argument passing by
 passing the default record and overriding selected arguments.

 An (incomplete) list of the sort of combinators we will need:

 * union = mconcat (put a bunch of diagrams on top of one another)
 * cat (lay out a bunch of diagrams next to each other)

   this one should have lots of arguments in its record, e.g. direction
 along which to lay out the diagrams; separation between diagrams;
 alignment; distribution method (see e.g. inkscape's align/distribute panel
 for inspiration)

 It may be worth predefining a few aliases for cat with one or two
 arguments filled in, e.g. hcat and vcat for the common cases of laying out
 diagrams horizontally or vertically, and so on.

 * along (lay out diagrams along a path)

   not sure of the right API for this, but there might be options for
 spacing, distribution, that sort of thing.  In fact, 'cat' could (and
 probably should) be implemented in terms of 'along', by first creating an
 appropriate (straight) path and then calling 'along'.  Perhaps 'cat' and
 'along' really ought to be unified into one primitive.

Ticket URL: <http://trac.haskell.org/diagrams/ticket/13>
diagrams <http://code.haskell.org/diagrams/>
Embedded domain-specific library for describing and rendering diagrams, illustrations, and other graphics.

More information about the diagrams mailing list