packages feed

validity-vector 0.2.0.1 → 0.2.0.2

raw patch · 2 files changed

+24/−11 lines, 2 files

Files

src/Data/Validity/Vector.hs view
@@ -4,12 +4,23 @@  import Data.Validity -import Data.Vector (Vector) import qualified Data.Vector as V+import qualified Data.Vector.Storable as SV+import qualified Data.Vector.Storable.Mutable as MSV+import qualified Data.Vector.Unboxed as UV+import qualified Data.Vector.Unboxed.Mutable as MUV +import GHC.Exts as GHC (IsList(..))+ -- | A 'Vector' of things is valid if all the elements are valid. -- -- TODO make a more comprehensive instance that looks at implementation and -- the underlying 'Array'-instance (Validity a) => Validity (Vector a) where+instance Validity a => Validity (V.Vector a) where     validate hs = annotate (V.toList hs) "Vector elements"++instance (MUV.Unbox e, Validity e) => Validity (UV.Vector e) where+    validate = delve "Vector elements" . UV.toList++instance (MSV.Storable e, Validity e) => Validity (SV.Vector e) where+    validate = delve "Vector elements" . GHC.toList
validity-vector.cabal view
@@ -1,29 +1,35 @@--- This file has been generated from package.yaml by hpack version 0.20.0.+cabal-version: >= 1.10++-- This file has been generated from package.yaml by hpack version 0.29.6. -- -- see: https://github.com/sol/hpack ----- hash: 247cddf1bed793a636a1f6793e05092fb13d068aaed4f2769f017be82db18f00+-- hash: 767155de4ad7cf58e496122f399d1a2c34659ca73beebdd996c6c0184b69f9f9  name:           validity-vector-version:        0.2.0.1+version:        0.2.0.2 synopsis:       Validity instances for vector description:    Please see README.md category:       Validity homepage:       https://github.com/NorfairKing/validity#readme bug-reports:    https://github.com/NorfairKing/validity/issues author:         Tom Sydney Kerckhove-maintainer:     syd.kerckhove@gmail.com+maintainer:     syd.kerckhove@gmail.com,+                nick.van.den.broeck666@gmail.com copyright:      Copyright: (c) 2017-2018 Tom Sydney Kerckhove license:        MIT license-file:   LICENSE build-type:     Simple-cabal-version:  >= 1.10  source-repository head   type: git   location: https://github.com/NorfairKing/validity  library+  exposed-modules:+      Data.Validity.Vector+  other-modules:+      Paths_validity_vector   hs-source-dirs:       src   build-depends:@@ -31,8 +37,4 @@     , hashable     , validity >=0.5     , vector-  exposed-modules:-      Data.Validity.Vector-  other-modules:-      Paths_validity_vector   default-language: Haskell2010