For Vec2, Vec3, and others from Data.Vector.Fixed.Boxed, I see a Functor instance, so something like this type-checks:
fff :: B.Vec2 Int -> B.Vec2 Int
fff = fmap (+1)
and fmap is just Data.Vector.Fixed.map.
However, something doesn't
ggg :: V.Vector v Int => v Int -> v Int
ggg = fmap (+1)
unless I explicitly require that v also be a Functor, like this
ggg :: (Functor v, V.Vector v Int) => v Int -> v Int
ggg = fmap (+1)
even though the function Data.Vector.Fixed.map can be used successfully,
ggg :: V.Vector v Int => v Int -> v Int
ggg = V.map (+1)
So my question is the following: since Data.Vector.Fixed.Vector represents a list-like thing (although of fixed size), why doesn't any instance of it also implement Functor? I would expect it not to implement Monad (even though...), but Functor seems to be doable.
Is there a fundamental reason why Vector is not also Functor?
Assumed
import qualified Data.Vector.Fixed as V
import qualified Data.Vector.Fixed.Boxed as B