On Mon, Apr 27, 2015 at 07:20:31PM -0700, Kevin Meredith wrote:
> Why does an implicit exist for Ring[Jet[Double/Float]], but not for
> Ring[Jet[Int/BigInt/Long]]?
In this case it's actually more of a programming reason: the JetIsRing
trait which extends Ring[Jet[T]] requires a Field[T] (among other
things). The reason for this is that most of Jet[T]'s operations
(e.g. + and -) require a Field[T].
Jet[T] exists primarily to facilitate automatic differentiation [1],
something we don't directly support in Spire yet. It should be
possible to relax Jet's operators to only require the minimal
algebraic structures (e.g. an AdditiveSemigroup[T] instead of a
Field[T] for +).
It's not clear to me how useful this change would be -- I don't use
Jet[T] extensively and haven't needed a Jet[Int]. If you have a use
case for Jet[Int] (or even just a desire to "fix" this) I'd be happy
to get a PR that loosens these sorts of constraints.
Thanks,
-- Erik
[1]
https://en.wikipedia.org/wiki/Automatic_differentiation