Proposal: Add "fma" to the RealFloat class
wren romano
winterkoninkje at gmail.com
Thu Apr 30 17:56:21 UTC 2015
On Wed, Apr 29, 2015 at 11:48 AM, Edward Kmett <ekmett at gmail.com> wrote:
> Good point. If we wanted to we could push this all the way up to Num given
> the operations involved, and I could see that you could benefit from it
> there for types that have nothing to do with floating point, e.g. modular
> arithmetic could get away with using a single 'mod'.
I'm strongly in favor of adding fma *somewhere*, even if just as a
family of primops; though, of course, it'd be nicer to put it in a
type class so we don't have to pull in GHC.Exts. And as far as type
classes go, I'm strongly in favor of pushing it all the way up to Num
(or rather, to Semiring if only we had such a thing). There's no
conceptual reason for it to live in RealFloat.
--
Live well,
~wren
More information about the Libraries
mailing list