Closed stites closed 6 years ago
This would make all instances ever for Backprop
be overlapping instances, even for types that don't have Num
instances, which is a bit too dangerous/playing with fire -- definitely not something that the haskell type system was designed to handle, heh.
An alternative nice solution would probably leverage DerivingVia
when that extension lands (ghc-proposals/ghc-proposals#120) to allow deriving with Num or Generics.
It also precludes the possibility of a type implementing its own instance of Backprop if it has a Num instance, even if there is a potentially faster implementation than addNum
/zeroNum
/oneNum
:+1: yup, makes sense!
which would be satisfied with the
*Num
functions?