diff --git a/Data/Vector/Mutable.hs b/Data/Vector/Mutable.hs index 5c2fde11..62eaafc2 100644 --- a/Data/Vector/Mutable.hs +++ b/Data/Vector/Mutable.hs @@ -1,5 +1,9 @@ {-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, BangPatterns, TypeFamilies #-} +#if __GLASGOW_HASKELL__ >= 708 +{-# LANGUAGE RoleAnnotations #-} +#endif + -- | -- Module : Data.Vector.Mutable -- Copyright : (c) Roman Leshchinskiy 2008-2010 @@ -62,6 +66,10 @@ import Data.Typeable ( Typeable ) #include "vector.h" +#if __GLASGOW_HASKELL__ >= 708 +type role MVector nominal representational +#endif + -- | Mutable boxed vectors keyed on the monad they live in ('IO' or @'ST' s@). data MVector s a = MVector {-# UNPACK #-} !Int {-# UNPACK #-} !Int diff --git a/Data/Vector/Primitive.hs b/Data/Vector/Primitive.hs index 50c47b5b..66388667 100644 --- a/Data/Vector/Primitive.hs +++ b/Data/Vector/Primitive.hs @@ -1,5 +1,9 @@ {-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, TypeFamilies, ScopedTypeVariables, Rank2Types #-} +#if __GLASGOW_HASKELL__ >= 708 +{-# LANGUAGE RoleAnnotations #-} +#endif + -- | -- Module : Data.Vector.Primitive -- Copyright : (c) Roman Leshchinskiy 2008-2010 @@ -177,6 +181,10 @@ import Data.Traversable ( Traversable ) import qualified GHC.Exts as Exts #endif +#if __GLASGOW_HASKELL__ >= 708 +type role Vector representational +#endif + -- | Unboxed vectors of primitive types data Vector a = Vector {-# UNPACK #-} !Int {-# UNPACK #-} !Int diff --git a/Data/Vector/Storable.hs b/Data/Vector/Storable.hs index 1093581c..fc2beac6 100644 --- a/Data/Vector/Storable.hs +++ b/Data/Vector/Storable.hs @@ -1,5 +1,9 @@ {-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, TypeFamilies, Rank2Types, ScopedTypeVariables #-} +#if __GLASGOW_HASKELL__ >= 708 +{-# LANGUAGE RoleAnnotations #-} +#endif + -- | -- Module : Data.Vector.Storable -- Copyright : (c) Roman Leshchinskiy 2009-2010 @@ -186,6 +190,10 @@ import qualified GHC.Exts as Exts #define NOT_VECTOR_MODULE #include "vector.h" +#if __GLASGOW_HASKELL__ >= 708 +type role Vector representational +#endif + -- | 'Storable'-based vectors data Vector a = Vector {-# UNPACK #-} !Int {-# UNPACK #-} !(ForeignPtr a) diff --git a/Data/Vector/Storable/Mutable.hs b/Data/Vector/Storable/Mutable.hs index a1cd3f49..bc8788b4 100644 --- a/Data/Vector/Storable/Mutable.hs +++ b/Data/Vector/Storable/Mutable.hs @@ -1,5 +1,9 @@ {-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, MagicHash, MultiParamTypeClasses, ScopedTypeVariables #-} +#if __GLASGOW_HASKELL__ >= 708 +{-# LANGUAGE RoleAnnotations #-} +#endif + -- | -- Module : Data.Vector.Storable.Mutable -- Copyright : (c) Roman Leshchinskiy 2009-2010 @@ -93,6 +97,10 @@ import Data.Typeable ( Typeable ) #define NOT_VECTOR_MODULE #include "vector.h" +#if __GLASGOW_HASKELL__ >= 708 +type role MVector nominal representational +#endif + -- | Mutable 'Storable'-based vectors data MVector s a = MVector {-# UNPACK #-} !Int {-# UNPACK #-} !(ForeignPtr a)