validity-containers-0.3.1.0/src/0000755000000000000000000000000013216764035014625 5ustar0000000000000000validity-containers-0.3.1.0/src/Data/0000755000000000000000000000000013216764035015476 5ustar0000000000000000validity-containers-0.3.1.0/src/Data/Validity/0000755000000000000000000000000013315612005017250 5ustar0000000000000000validity-containers-0.3.1.0/src/Data/Validity/Containers.hs0000644000000000000000000000032513216764035021724 0ustar0000000000000000module Data.Validity.Containers where import Data.Validity.Map as Containers () import Data.Validity.Sequence as Containers () import Data.Validity.Set as Containers () import Data.Validity.Tree as Containers () validity-containers-0.3.1.0/src/Data/Validity/Tree.hs0000644000000000000000000000051213315612005020501 0ustar0000000000000000{-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Validity.Tree where import Data.Validity import Data.Tree -- | A 'Tree' of things is valid if all the things in the 'Tree' are valid. instance Validity a => Validity (Tree a) where validate (Node rl sf) = mconcat [annotate rl "rootLabel", annotate sf "subForest"] validity-containers-0.3.1.0/src/Data/Validity/Map.hs0000644000000000000000000000073613315612005020327 0ustar0000000000000000{-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Validity.Map where import Data.Validity import Data.Map (Map) import qualified Data.Map as M -- | A 'Map' of things is valid if all the keys and values are valid and the 'Map' itself -- is valid. instance (Ord k, Validity k, Validity v) => Validity (Map k v) where validate m = mconcat [ declare "The Map structure is valid." $ M.valid m , delve "Map elements" $ M.toList m ] validity-containers-0.3.1.0/src/Data/Validity/Sequence.hs0000644000000000000000000000050213315612005021351 0ustar0000000000000000{-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Validity.Sequence where import Data.Validity import Data.Foldable (toList) import Data.Sequence (Seq) -- | A 'Seq'uence of things is valid if all the elements are valid. instance Validity v => Validity (Seq v) where validate s = annotate (toList s) "Seq elements" validity-containers-0.3.1.0/src/Data/Validity/Set.hs0000644000000000000000000000071413315612005020341 0ustar0000000000000000{-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Validity.Set where import Data.Validity import Data.Set (Set) import qualified Data.Set as S -- | A 'Set' of things is valid if all the elements are valid and the 'Set' itself -- is valid. instance (Ord v, Validity v) => Validity (Set v) where validate s = mconcat [ declare "The set structure is valid." $ S.valid s , annotate (S.toList s) "Set elements" ] validity-containers-0.3.1.0/LICENSE0000644000000000000000000000207713216764035015051 0ustar0000000000000000The MIT License (MIT) Copyright (c) 2016 Tom Sydney Kerckhove Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. validity-containers-0.3.1.0/Setup.hs0000644000000000000000000000005713216764035015474 0ustar0000000000000000import Distribution.Simple main = defaultMain validity-containers-0.3.1.0/validity-containers.cabal0000644000000000000000000000226713315065271021015 0ustar0000000000000000-- This file has been generated from package.yaml by hpack version 0.28.2. -- -- see: https://github.com/sol/hpack -- -- hash: 77cb2b975040064ad6346e213a7a6f93161985fcb67d7b8949aa00fcd8f9617d name: validity-containers version: 0.3.1.0 synopsis: Validity instances for containers 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, nick.van.den.broeck666@gmail.com copyright: Copyright: (c) 2016-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 hs-source-dirs: src build-depends: base >=4.7 && <5 , containers , validity >=0.5 exposed-modules: Data.Validity.Containers Data.Validity.Tree Data.Validity.Map Data.Validity.Sequence Data.Validity.Set other-modules: Paths_validity_containers default-language: Haskell2010