Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix roles for Vector and MVector size parameters #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## WIP

- Fix roles for `MVector` and `Vector` to no longer declare their sizes as
phantom

## [1.6.1]

- Fix build against Stackage nightly for GHC 9.4.5
Expand Down
3 changes: 3 additions & 0 deletions src/Data/Vector/Generic/Mutable/Sized/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RoleAnnotations #-}
{-# OPTIONS_HADDOCK not-home #-}

module Data.Vector.Generic.Mutable.Sized.Internal
Expand All @@ -20,3 +21,5 @@ import Foreign.Storable
-- which have a different length than that specified in the type parameter!
newtype MVector v (n :: Nat) s a = MVector (v s a)
deriving ( Typeable, Data, Storable, NFData )

type role MVector representational nominal nominal nominal
3 changes: 3 additions & 0 deletions src/Data/Vector/Generic/Sized/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RoleAnnotations #-}
{-# OPTIONS_HADDOCK not-home #-}

module Data.Vector.Generic.Sized.Internal
Expand Down Expand Up @@ -52,6 +53,8 @@ newtype Vector v (n :: Nat) a = Vector (v a)
, Data, Typeable
)

type role Vector representational nominal nominal

instance (Ix a, Ord (v a), VG.Vector v a) => Ix (Vector v n a) where

-- range is consistent with range :: ((a,..,a), (a,..,a)) -> [(a,..,a)]
Expand Down
Loading