validity-unordered-containers (empty) → 0.0.0.0
raw patch · 6 files changed
+93/−0 lines, 6 filesdep +basedep +hashabledep +unordered-containerssetup-changed
Dependencies added: base, hashable, unordered-containers, validity
Files
- LICENSE +21/−0
- Setup.hs +3/−0
- src/Data/Validity/HashMap.hs +16/−0
- src/Data/Validity/HashSet.hs +15/−0
- src/Data/Validity/UnorderedContainers.hs +6/−0
- validity-unordered-containers.cabal +32/−0
+ LICENSE view
@@ -0,0 +1,21 @@+The MIT License (MIT)++Copyright (c) 2017 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.
+ Setup.hs view
@@ -0,0 +1,3 @@+import Distribution.Simple++main = defaultMain
+ src/Data/Validity/HashMap.hs view
@@ -0,0 +1,16 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Data.Validity.HashMap where++import Data.Validity++import Data.Hashable (Hashable)+import Data.HashMap.Strict (HashMap)+import qualified Data.HashMap.Strict as HM++-- | A 'HashMap' of things is valid if all the keys and values are valid.+--+-- The 'unordered-containers' package does not export any more functionality+-- concerning a 'HashMap', so no more accurate validity instance can be made.+instance (Hashable k, Validity k, Validity v) => Validity (HashMap k v) where+ isValid m = all isValid (HM.toList m)
+ src/Data/Validity/HashSet.hs view
@@ -0,0 +1,15 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Data.Validity.HashSet where++import Data.Validity+import Data.Validity.HashMap ()++import Data.HashSet (HashSet)+import qualified Data.HashSet as HS+import Data.Hashable (Hashable)++-- | A 'HashSet' of things is valid if all the elements are valid and+-- the underlying 'HashMap' is valid.+instance (Hashable v, Validity v) => Validity (HashSet v) where+ isValid hs = isValid $ HS.toMap hs
+ src/Data/Validity/UnorderedContainers.hs view
@@ -0,0 +1,6 @@+module Data.Validity.UnorderedContainers+ ( module UnorderedContainers+ ) where++import Data.Validity.HashMap as UnorderedContainers ()+import Data.Validity.HashSet as UnorderedContainers ()
+ validity-unordered-containers.cabal view
@@ -0,0 +1,32 @@+name: validity-unordered-containers+version: 0.0.0.0+cabal-version: >=1.10+build-type: Simple+license: MIT+license-file: LICENSE+copyright: Copyright: (c) 2017 Tom Sydney Kerckhove+maintainer: syd.kerckhove@gmail.com+homepage: https://github.com/NorfairKing/validity#readme+synopsis: Validity instances for unordered-containers+description:+ Please see README.md+category: Validity+author: Tom Sydney Kerckhove++source-repository head+ type: git+ location: https://github.com/NorfairKing/validity++library+ exposed-modules:+ Data.Validity.UnorderedContainers+ Data.Validity.HashMap+ Data.Validity.HashSet+ build-depends:+ base >= 4.7 && <5,+ validity >=0.3 && <0.4,+ unordered-containers >= 0.2.7,+ hashable -any+ default-language: Haskell2010+ hs-source-dirs: src+