fixed-point 0.4.0.1 → 0.5.0.0
raw patch · 2 files changed
+3/−57 lines, 2 filesdep −vectorPVP ok
version bump matches the API change (PVP)
Dependencies removed: vector
API changes (from Hackage documentation)
- Data.Fixed.Binary: instance MVector MVector a => MVector MVector (Fixed r a)
- Data.Fixed.Binary: instance Unbox a => Unbox (Fixed r a)
- Data.Fixed.Binary: instance Vector Vector a => Vector Vector (Fixed r a)
Files
- Data/Fixed/Binary.hs +0/−52
- fixed-point.cabal +3/−5
Data/Fixed/Binary.hs view
@@ -3,7 +3,6 @@ {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ViewPatterns #-}@@ -32,7 +31,6 @@ import Control.Applicative import Control.Arrow-import Control.Monad import Data.Bits import Data.Fixed (div', mod', divMod') import Data.Function@@ -45,10 +43,6 @@ import Text.Read import qualified Text.Read.Lex as L -import qualified Data.Vector.Generic as VG-import qualified Data.Vector.Generic.Mutable as VGM-import qualified Data.Vector.Unboxed as VU- -- | The first type parameter represents the number of bits to devote -- to the fractional part of the number. The second type parameter is -- the underlying representation. For example, @Fixed E8 Int16@ uses@@ -57,51 +51,6 @@ newtype Fixed r a = Fixed { unFixed :: a } deriving (Bounded, Enum, Eq, Ord, Typeable) -newtype instance VU.MVector s (Fixed r a) = MVFixed { unMVFixed :: VU.MVector s a }-newtype instance VU.Vector (Fixed r a) = VFixed { unVFixed :: VU.Vector a }--instance VGM.MVector VU.MVector a => VGM.MVector VU.MVector (Fixed r a) where- {-# INLINE basicLength #-}- basicLength = VGM.basicLength . unMVFixed- {-# INLINE basicUnsafeSlice #-}- basicUnsafeSlice i n = MVFixed . VGM.basicUnsafeSlice i n . unMVFixed- {-# INLINE basicOverlaps #-}- basicOverlaps = VGM.basicOverlaps `on` unMVFixed- {-# INLINE basicUnsafeNew #-}- basicUnsafeNew = liftM MVFixed . VGM.basicUnsafeNew- {-# INLINE basicUnsafeReplicate #-}- basicUnsafeReplicate n = liftM MVFixed . VGM.basicUnsafeReplicate n . unFixed- {-# INLINE basicUnsafeRead #-}- basicUnsafeRead (MVFixed mv) = liftM Fixed . VGM.basicUnsafeRead mv- {-# INLINE basicUnsafeWrite #-}- basicUnsafeWrite (MVFixed mv) i = VGM.basicUnsafeWrite mv i . unFixed- {-# INLINE basicClear #-}- basicClear = VGM.basicClear . unMVFixed- {-# INLINE basicSet #-}- basicSet (MVFixed mv) = VGM.basicSet mv . unFixed- {-# INLINE basicUnsafeCopy #-}- basicUnsafeCopy = VGM.basicUnsafeCopy `on` unMVFixed- {-# INLINE basicUnsafeGrow #-}- basicUnsafeGrow (MVFixed mv) = liftM MVFixed . VGM.basicUnsafeGrow mv--instance VG.Vector VU.Vector a => VG.Vector VU.Vector (Fixed r a) where- {-# INLINE basicUnsafeFreeze #-}- basicUnsafeFreeze = liftM VFixed . VG.basicUnsafeFreeze . unMVFixed- {-# INLINE basicUnsafeThaw #-}- basicUnsafeThaw = liftM MVFixed . VG.basicUnsafeThaw . unVFixed- {-# INLINE basicLength #-}- basicLength = VG.basicLength . unVFixed- {-# INLINE basicUnsafeSlice #-}- basicUnsafeSlice i n = VFixed . VG.basicUnsafeSlice i n . unVFixed- {-# INLINE basicUnsafeIndexM #-}- basicUnsafeIndexM (VFixed v) = liftM Fixed . VG.basicUnsafeIndexM v- {-# INLINE basicUnsafeCopy #-}- basicUnsafeCopy (MVFixed mv) = VG.basicUnsafeCopy mv . unVFixed- {-# INLINE elemseq #-}- elemseq (VFixed v) = VG.elemseq v . unFixed--instance VU.Unbox a => VU.Unbox (Fixed r a)- inFixed :: (a -> b) -> (Fixed r a -> Fixed s b) {-# INLINE inFixed #-} inFixed = (Fixed .) . (. unFixed)@@ -187,7 +136,6 @@ fromRational r = withResolution $ \s -> Fixed . floor $ (numerator r `shiftL` s) % denominator r --- TODO Make these more efficient. instance ( HasResolution r, Bits a, Bits (Super a), Integral a , Integral (Super a), SuperTypeable a) => RealFrac (Fixed r a) where {-# INLINE properFraction #-}
fixed-point.cabal view
@@ -1,5 +1,5 @@ Name: fixed-point-Version: 0.4.0.1+Version: 0.5.0.0 Synopsis: Binary fixed-point arithmetic Description: This package defines a type for binary fixed-precision arithmetic. The main differences@@ -29,15 +29,13 @@ Cabal-version: >=1.6 Library- Build-depends: base == 4.3.*,- vector == 0.7.*+ Build-depends: base == 4.3.* Exposed-modules: Data.Fixed.Binary Extensions: CPP, DeriveDataTypeable, EmptyDataDecls, FlexibleContexts, GeneralizedNewtypeDeriving,- MultiParamTypeClasses, TypeFamilies, TypeOperators, ViewPatterns@@ -50,4 +48,4 @@ source-repository this type: darcs location: http://patch-tag.com/r/jmcarthur/fixed-point- tag: v0.4.0.0+ tag: v0.5.0.0