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

Upgrades, and introduction of utils namespace #24

Merged
merged 24 commits into from
Jun 24, 2021
Merged

Conversation

lfborjas
Copy link
Owner

@lfborjas lfborjas commented Jun 18, 2021

lfborjas added 24 commits June 18, 2021 18:04
Haven't quite figured out how to have Nix also generate the haddock,
but at least it currently generates a cabal build + the tarball.
This is not _oficially_ part of swiss ephemeris, but it was shared by
Alois in a forum message and expressed to have the same license:

https://groups.io/g/swisseph/message/5564
* Correct some includes in the C libs to actually work
  within the existing SWE ecosystem.
* Introduce very basic bindings to the grav_group* functions.
A bit clunky in the API, but it makes sense (?)
Leverages the somewhat naïve `housesToCusps` function, also introduced,
for the EZ versions.
* Couple of tests demonstrating both `groupGrav` strategies
* Use `CInt` for the boolean argument to `group_grav2` to be compatible
  with haskells <= ghc8.0.2
Also, introduce tentative testing on ghc 9!
This is but one of the tiny things we had capitulated on for ghc <= 8.0.2
(also, `(<>)` from semigroup included in Prelude -- not a fan of `(++)`)
Using a somewhat brutalist "I see int, I write double" approach. Trying
to lay the groundwork for avoiding precision-losing roundtripping of
positions.
* Accepts instances of the new `HasEclipticLongitude` class: anything
  that can be located in the ecliptic. That way, we can send any product
  of `(Planet, HasEclipticLongitude)`, vs. being tied to `EclipticPosition`
* Returns the `GlyphInfo` objects only: this avoids the wasteful
  "pairing back up" state, but it preserves enough information to
  meaninfully zip it back up -- by the caller, not us.
There's a few functions that expect a char* (string) but are _not_
guaranteed to initialize it. One should either provide an array of
characters with an explicit length, or a NUL-terminated string. I'm
chosing the latter to strike a balance between memory conservancy
and safety, via `withCAString` (since strings seem to be ASCII
coming from SWE.) We could also use `withCAStringLen`, which seems
to be equivalent to the `allocaArray` approach being replaced here.

See #9 and:

https://www.haskell.org/onlinereport/haskell2010/haskellch27.html
@lfborjas lfborjas merged commit 7edfb51 into master Jun 24, 2021
@lfborjas lfborjas deleted the upgrades-grav-objs branch June 24, 2021 02:09
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 this pull request may close these issues.

Make buildable in nix Include the "grav_group" functions for graphics assistance
1 participant