D naming conventions: How is Phobos organized?

Viewed 422

I'm making my own little library of handy functions and I'm trying to follow Phobos's naming convention but I'm getting really confused. How do I know where things would fit?

Example:

If there was a function like foldRight in Phobos (basically reduce in the reverse direction), which module would I find it in?

I can think of several:

  • std.algorithm: Because it's expressing an algorithm
  • std.array: Because I'm likely going to use it on arrays
  • std.container: Because it's used on containers, rather than single objects
  • std.functional: Because it's used mainly in functional programming
  • std.range: Because it operates on ranges as well

but I have no idea which one would be a good choice -- I could give a convincing argument for at least 3 of them.

What's the convention?

1 Answers
Related