fixed-vector 1.2.1.1 → 1.2.2.1
raw patch · 3 files changed
+22/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Vector.Fixed: StorableViaFixed :: v a -> StorableViaFixed v a
+ Data.Vector.Fixed: instance (Data.Vector.Fixed.Cont.Vector v a, Foreign.Storable.Storable a) => Foreign.Storable.Storable (Data.Vector.Fixed.StorableViaFixed v a)
+ Data.Vector.Fixed: newtype StorableViaFixed v a
Files
- ChangeLog.md +5/−0
- Data/Vector/Fixed.hs +16/−0
- fixed-vector.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+Changes in 1.2.2.1++ * Newtype `StorableViaFixed` for deriving `Storable` instances added.++ Changes in 1.2.1.1 * Fixed bug in `any` (#18)
Data/Vector/Fixed.hs view
@@ -12,6 +12,7 @@ {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}@@ -146,6 +147,7 @@ , izipWithM_ -- * Storable methods -- $storable+ , StorableViaFixed(..) , defaultAlignemnt , defaultSizeOf , defaultPeek@@ -173,6 +175,7 @@ import Control.Applicative (Applicative(..),(<$>)) import Control.DeepSeq (NFData(..))+import Data.Coerce import Data.Data (Typeable,Data) import Data.Monoid (Monoid(..)) import Data.Semigroup (Semigroup(..))@@ -303,6 +306,19 @@ {-# INLINE peek #-} {-# INLINE poke #-} +-- | Newtype for deriving 'Storable' instance for data types which has+-- instance of 'Vector'+newtype StorableViaFixed v a = StorableViaFixed (v a)++instance (Vector v a, Storable a) => Storable (StorableViaFixed v a) where+ alignment = coerce (defaultAlignemnt @a @v)+ sizeOf = coerce (defaultSizeOf @a @v)+ peek = coerce (defaultPeek @a @v)+ poke = coerce (defaultPoke @a @v)+ {-# INLINE alignment #-}+ {-# INLINE sizeOf #-}+ {-# INLINE peek #-}+ {-# INLINE poke #-} -- | Single-element tuple.
fixed-vector.cabal view
@@ -1,5 +1,5 @@ Name: fixed-vector-Version: 1.2.1.1+Version: 1.2.2.1 Synopsis: Generic vectors with statically known size. Description: Generic library for vectors with statically known