ekmett / ekmett/linear

N-dimensional bounding-boxes

Open
#135 11 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Haskell
Stars
220
Forks
55
PR merge metrics
No merged PRs in 30d

Description

This might be a tad too low-brow for your tastes, but is there any chance we could export a simple polymorphic n-dimensional `BoundingBox` (or similarly named) type from this library?

Given the universality of this package (and how it ties in quite nicely with the `V[N]` types)

Since there is no 'standard' type, people keep defining their own, making interop a bit of a trudge (and Haskellers don't trudge; they stride, right).

My own definition looks a bit like this:

```haskell
data BoundingBox v = BoundingBox { cornerOf :: v, sizeOf :: v } deriving (Show, Eq)
```

The suffix is partly for aesthetics (`cornerOf box` reads nicely; `of` is a nice synonym for `flip (^.)`, come to think of it), partly a guide for lens generation.

This got a bit long (sorry), but I have a final question: if this functionality should *not* be part of `linear`, do you have a suggestion for where it might fit in? Is there already a nice library that *could* become the de-facto standard? Where should I turn for this type of discussion?

Thanks for the good work.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.