-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add geometric mean primitive #65
base: master
Are you sure you want to change the base?
Conversation
So I've realized that I just... can't do division? please advise |
Okay, so the code that I have is geomean ∷ NonEmptyList Quantity → Result
geomean xs = (_ `pow` ( one / n)) <$> foldM (⊗) (head xs) (tail xs)
where
n = Decimal.fromInt (length xs)
and the error at hand is
|
Co-authored-by: David Peter <[email protected]>
Thank you very much for creating this — and sorry for not getting back to you earlier. I have been working on a rewrite of Insect over the past year. I will likely not make further updates to Insect. If you are still interested in this feature, maybe you could add it to Numbat instead? (https://github.com/sharkdp/numbat) There are three places to look (following the example of
|
I'd like to add a geometric mean primitive to Insect and this seems like the first step! I've never seen Purescript before now so this is probably going to be quite broken.