anyways, it looks like the Pure / immutable vector data type in inline-r has a spurious state token argument in its definition that shouldn't be there, OR there need to be two "s" params in inline-r instead of the one
-- #if MIN_VERSION_base(4,9,0) type family Mutable (v :: * -> *) = (mv :: * -> * -> *) | mv -> v #else type family Mutable (v :: * -> *) :: * -> * -> * #endif
-- | Mutable R vector. Represented in memory with the same header as 'SEXP' | |
-- nodes. The second type parameter is phantom, reflecting at the type level the -- tag of the vector when viewed as a 'SEXP'. The tag of the vector and the -- representation type are related via 'ElemRep'. data MVector s ty a = MVector { mvectorBase :: {-# UNPACK #-} !(SEXP s ty) , mvectorOffset :: {-# UNPACK #-} !Int32 , mvectorLength :: {-# UNPACK #-} !Int32 } -- | Internal wrapper type for reflection. First type parameter is the reified -- type to reflect. newtype W t ty s a = W { unW :: MVector s ty a } instance (Reifies t (AcquireIO s), VECTOR s ty a) => G.MVector (W t ty) a where |
data Vector s (ty :: SEXPTYPE) a = Vector | |
{ vectorBase :: {-# UNPACK #-} !(ForeignSEXP ty) , vectorOffset :: {-# UNPACK #-} !Int32 , vectorLength :: {-# UNPACK #-} !Int32 | |
} | |
type instance G.Mutable (W t ty s) = Mutable.W t ty |
were you using the same version of vector in both setups?in the most recent vector release we made mutable type family injective in the vector package for ghc's that support it ...On Sat, Dec 29, 2018 at 1:50 PM Dominick Samperi <djsamperi@gmail.com> wrote:When I use v8.6.3 of GHC under Ubuntu to install the inline-r package
I get the error "Type family equation violates injectivity annotation," and
a type variable on the LHS cannot be inferred from the RHS, due to
the lack of injectivity (I suppose).
On the other hand, v8.0.2 of GHC (shipped with Haskell Platform under
Ubuntu) does not have this problem (it has other problems).
Has something changed in the latest version of the compiler that might
cause this? Possible work-around?
FYI, the line that triggers the error is:
type instance G.Mutable (W t ty s) = Mutable.W t ty
The variable that cannot be inferred is 's'.
Thanks,
Dominick
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs