packages feed

validity-primitive (empty) → 0.0.0.0

raw patch · 4 files changed

+79/−0 lines, 4 filesdep +basedep +primitivedep +validitysetup-changed

Dependencies added: base, primitive, validity

Files

+ LICENSE view
@@ -0,0 +1,21 @@+The MIT License (MIT)++Copyright (c) 2018 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/Primitive.hs view
@@ -0,0 +1,17 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+{-# LANGUAGE CPP #-}++module Data.Validity.Primitive where++import Data.Validity++import qualified Data.Primitive.Array as A+#if MIN_VERSION_primitive(0,6,2)+instance Validity a => Validity (A.Array a) where+    validate = foldMap validate+#else+instance Validity a => Validity (A.Array a) where+    validate xs =+        let n = I# (sizeofArray# (array# xs))+         in delve "Primitive array" . validate $ indexArray xs <$> [0 .. n - 1]+#endif
+ validity-primitive.cabal view
@@ -0,0 +1,38 @@+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: de1c5c575a4a387824d4790cfb885a96c63655e43c44e1f5067f1ca4a048721b++name:           validity-primitive+version:        0.0.0.0+synopsis:       Validity instances for primitive+description:    Please see README.md+category:       Validity+homepage:       https://github.com/NorfairKing/validity#readme+bug-reports:    https://github.com/NorfairKing/validity/issues+author:         Nick Van den Broeck+maintainer:     syd.kerckhove@gmail.com+copyright:      Copyright: (c) 2017-2018 Tom Sydney Kerckhove+license:        MIT+license-file:   LICENSE+build-type:     Simple++source-repository head+  type: git+  location: https://github.com/NorfairKing/validity++library+  exposed-modules:+      Data.Validity.Primitive+  other-modules:+      Paths_validity_primitive+  hs-source-dirs:+      src+  build-depends:+      base >=4.7 && <5+    , primitive+    , validity >=0.5+  default-language: Haskell2010