Skip to content

Commit

Permalink
Fix incorrect coercion #223
Browse files Browse the repository at this point in the history
  • Loading branch information
idontgetoutmuch committed Oct 27, 2018
1 parent 12c608d commit 6bfe81b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Data/Vector/Mutable.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Data/Vector/Primitive.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Data/Vector/Storable.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions Data/Vector/Storable/Mutable.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6bfe81b

Please sign in to comment.