type-unary 0.1.5 → 0.1.6
raw patch · 2 files changed
+10/−2 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ TypeUnary.Vec: instance IsNat n => ToVec [a] n a
- TypeUnary.Vec: class ToVec c n a | c -> n a
+ TypeUnary.Vec: class ToVec c n a
Files
- src/TypeUnary/Vec.hs +9/−1
- type-unary.cabal +1/−1
src/TypeUnary/Vec.hs view
@@ -544,10 +544,18 @@ Conversion to vectors --------------------------------------------------------------------} -class ToVec c n a | c -> n a where+class ToVec c n a where toVec :: c -> Vec n a instance ToVec (Vec n a) n a where toVec = id++instance IsNat n => ToVec [a] n a where+ toVec = toVecL nat++toVecL :: Nat n -> [a] -> Vec n a+toVecL Zero [] = ZVec+toVecL (Succ m) (a:as) = a :< toVecL m as+toVecL _ _ = error "toVecL: length mismatch" {-------------------------------------------------------------------- Misc
type-unary.cabal view
@@ -1,5 +1,5 @@ Name: type-unary-Version: 0.1.5+Version: 0.1.6 Cabal-Version: >= 1.2 Synopsis: Type-level and typed unary natural numbers, vectors, inequality proofs