Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More combinators in D.Combinators #5

Closed
fryguybob opened this issue Aug 4, 2012 · 1 comment
Closed

More combinators in D.Combinators #5

fryguybob opened this issue Aug 4, 2012 · 1 comment
Assignees

Comments

@fryguybob
Copy link
Member

(Imported from http://code.google.com/p/diagrams/issues/detail?id=3. Original issue from byor...@gmail.com on December 23, 2010, 10:17:59 PM UTC)

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.

@fryguybob
Copy link
Member Author

(Imported. Original comment by byor...@gmail.com on April 2, 2011, 06:17:01 PM UTC)

There are certainly more things that could be added, but at this point I've coded pretty much everything discussed in the above note.

@ghost ghost assigned byorgey Aug 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants