type-unary 0.2.15 → 0.2.16
raw patch · 2 files changed
+10/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- src/TypeUnary/Vec.hs +9/−1
- type-unary.cabal +1/−1
src/TypeUnary/Vec.hs view
@@ -151,7 +151,12 @@ -- compare' :: (IsNat n, Ord a) => Vec n a -> Vec n a -> Ordering -- compare' = (fmap.fmap) fold (liftA2 compare) +-- instance Show (Vec Z a) where+-- show _ = "ZVec" +-- instance Show a => Show (Vec (S n) a) where+-- show v = "elemsV " ++ show (toList v)+ instance Show a => Show (Vec n a) where show v = "elemsV " ++ show (toList v) @@ -168,6 +173,7 @@ instance Functor (Vec n) where fmap _ ZVec = ZVec fmap f (a :< u) = f a :< fmap f u+ {-# INLINE fmap #-} instance IsNat n => Applicative (Vec n) where pure = pureV@@ -208,10 +214,12 @@ instance Foldable (Vec n) where foldr _ b ZVec = b foldr h b (a :< as) = a `h` foldr h b as+ {-# INLINE foldr #-} instance Traversable (Vec n) where traverse _ ZVec = pure ZVec traverse f (a :< as) = liftA2 (:<) (f a) (traverse f as)+ {-# INLINE traverse #-} instance Newtype (Vec Z a) () where pack () = ZVec@@ -250,7 +258,7 @@ (<+>) :: Vec m a -> Vec n a -> Vec (m :+: n) a ZVec <+> v = v (a :< u) <+> v = a :< (u <+> v)-+{-# INLINE (<+>) #-} peekV :: (IsNat n, Storable a) => Ptr a -> IO (Vec n a) peekV = peekV' nat
type-unary.cabal view
@@ -1,5 +1,5 @@ Name: type-unary-Version: 0.2.15+Version: 0.2.16 Cabal-Version: >= 1.6 Synopsis: Type-level and typed unary natural numbers, inequality proofs, vectors