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

Factor out Diagrams.Solve into a package? #235

Closed
jtdaugherty opened this issue Feb 22, 2015 · 10 comments · Fixed by #237
Closed

Factor out Diagrams.Solve into a package? #235

jtdaugherty opened this issue Feb 22, 2015 · 10 comments · Fixed by #237

Comments

@jtdaugherty
Copy link

I'd really love to use Diagrams.Solve, but I don't want to depend on diagrams-lib to do it. Would you be willing to factor this module out into a separate package? It looks like a relatively self-contained module so I imagine that wouldn't be onerous.

@byorgey
Copy link
Member

byorgey commented Feb 22, 2015

It wouldn't be onerous to separate out the code into a package, but it could be onerous to support. In particular the code in there is not based on any particular real knowledge of numerical computing. It happens to work for us so far, but I am quite sure there are lurking bugs and I am not sure I would want to encourage others to use it. On the other hand, maybe it would be a good way to get feedback and improve the code.

It continues to surprise me that there is no good package for numerical root-finding on Hackage. There is http://hackage.haskell.org/package/roots but it seems abandoned, though it could certainly be revived.

Our of curiosity, what would you want to use it for?

@jtdaugherty
Copy link
Author

I understand your concerns about support and correctness, although it's already public and people might already be using it, so moving it into another package would (at worst) just send the message that it's "more official" than it is now, but it'd be no more risky to use. (And it could be shipped with a disclaimer.)

I looked at roots, but it doesn't even remotely have the API I want, and Diagrams.Solve had exactly that API so I was very happy to discover it. :)

As for what I want to do, I'd like to use it in my ray tracer project, https://github.com/jtdaugherty/tracy. Right now I'm using diagrams-lib to get this module.

@byorgey
Copy link
Member

byorgey commented Feb 22, 2015

OK, fair enough. I'd be happy to split it out. The other thing that might be nice to split out is the tridiagonal matrix solver in https://github.com/diagrams/diagrams-lib/blob/master/src/Diagrams/CubicSpline/Internal.hs.

@jtdaugherty
Copy link
Author

Thank you!

@bergey
Copy link
Member

bergey commented Feb 23, 2015

I found myself copying Solve.hs into another project recently (err, also a raytracer, not nearly so far along). I agree that splitting it out would be better, even with the caveats about robustness.

@byorgey
Copy link
Member

byorgey commented Feb 23, 2015

OK, so now for the most difficult and important question: what should the
new package be called?

On Mon, Feb 23, 2015 at 9:00 AM, Daniel Bergey notifications@github.com
wrote:

I found myself copying Solve.hs into another project recently (err, also
a raytracer, not nearly so far along). I agree that splitting it out would
be better, even with the caveats about robustness.


Reply to this email directly or view it on GitHub
#235 (comment)
.

@jtdaugherty
Copy link
Author

So long as it isn't some tortured thing that starts with "h", I don't care! :)

@byorgey
Copy link
Member

byorgey commented Feb 24, 2015

OK, I think I will just call it diagrams-solve. That makes it clear that the main purpose is just to collect solving routines needed for diagrams, and if it happens to be useful to others, so much the better.

byorgey added a commit that referenced this issue Feb 27, 2015
Everything formerly in `Diagrams.Solve` is now in
`Diagrams.Solve.Polynomial` in the `diagrams-solve` package; the
tridiagonal solving code in `Diagrams.CubicSpline.Internal` was moved to
`Diagrams.Solve.Tridiagonal`.

Closes #235.
@byorgey
Copy link
Member

byorgey commented Apr 19, 2015

Uploaded diagrams-solve-0.1 to Hackage.

@jtdaugherty
Copy link
Author

Wonderful! Thank you! I've confirmed that my ray tracer works with the new package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants