summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorfair <>2019-08-19 11:30:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-08-19 11:30:00 (GMT)
commitd00aac01b7820625399746554df24917a81f9a86 (patch)
treef5a192d8b381860fb0a0a1da053ee1ddd0661177
version 0.0.0.00.0.0.0
-rw-r--r--ChangeLog.md3
-rw-r--r--LICENSE21
-rw-r--r--README.md1
-rw-r--r--Setup.hs3
-rw-r--r--genvalidity-typed-uuid.cabal64
-rw-r--r--src/Data/GenValidity/UUID/Typed.hs15
-rw-r--r--test/Data/UUID/TypedSpec.hs18
-rw-r--r--test/Spec.hs1
8 files changed, 126 insertions, 0 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 100644
index 0000000..a65ef28
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1,3 @@
+# Changelog for typed-uuid
+
+## Unreleased changes
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..2f3a2a5
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018-2019 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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b135e9d
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# genvalidity-typed-uuid
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
index 0000000..e8ef27d
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,3 @@
+import Distribution.Simple
+
+main = defaultMain
diff --git a/genvalidity-typed-uuid.cabal b/genvalidity-typed-uuid.cabal
new file mode 100644
index 0000000..1b37c8e
--- /dev/null
+++ b/genvalidity-typed-uuid.cabal
@@ -0,0 +1,64 @@
+cabal-version: 1.12
+
+-- This file has been generated from package.yaml by hpack version 0.31.1.
+--
+-- see: https://github.com/sol/hpack
+--
+-- hash: bd9e627175c8fa49b0aa071c7f0fcde2327e8c752a6db701a7a9d2d6b925de63
+
+name: genvalidity-typed-uuid
+version: 0.0.0.0
+synopsis: Generators for Phantom-Typed version of UUID
+description: Please see the README on Github at <https://github.com/NorfairKing/typed-uuid#readme>
+category: Data
+homepage: https://github.com/NorfairKing/typed-uuid#readme
+bug-reports: https://github.com/NorfairKing/typed-uuid/issues
+author: Tom Sydney Kerckhove
+maintainer: syd@cs-syd.eu
+copyright: Copyright: (c) 2018-2019 Tom Sydney Kerckhove
+license: MIT
+license-file: LICENSE
+build-type: Simple
+extra-source-files:
+ README.md
+ ChangeLog.md
+
+source-repository head
+ type: git
+ location: https://github.com/NorfairKing/typed-uuid
+
+library
+ exposed-modules:
+ Data.GenValidity.UUID.Typed
+ other-modules:
+ Paths_genvalidity_typed_uuid
+ hs-source-dirs:
+ src
+ build-depends:
+ QuickCheck
+ , base >=4.7 && <5
+ , genvalidity
+ , genvalidity-uuid >=0.0
+ , typed-uuid >=0.0
+ default-language: Haskell2010
+
+test-suite typed-uuid-test
+ type: exitcode-stdio-1.0
+ main-is: Spec.hs
+ other-modules:
+ Data.UUID.TypedSpec
+ Paths_genvalidity_typed_uuid
+ hs-source-dirs:
+ test
+ ghc-options: -threaded -rtsopts -with-rtsopts=-N
+ build-depends:
+ QuickCheck
+ , base >=4.7 && <5
+ , genvalidity
+ , genvalidity-hspec
+ , genvalidity-hspec-aeson
+ , genvalidity-typed-uuid
+ , genvalidity-uuid
+ , hspec
+ , typed-uuid
+ default-language: Haskell2010
diff --git a/src/Data/GenValidity/UUID/Typed.hs b/src/Data/GenValidity/UUID/Typed.hs
new file mode 100644
index 0000000..235310f
--- /dev/null
+++ b/src/Data/GenValidity/UUID/Typed.hs
@@ -0,0 +1,15 @@
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+
+module Data.GenValidity.UUID.Typed where
+
+import Data.GenValidity
+import Data.GenValidity.UUID ()
+import Data.UUID.Typed
+import Test.QuickCheck
+
+instance GenUnchecked (UUID a)
+
+instance GenValid (UUID a)
+
+instance Arbitrary (UUID a) where
+ arbitrary = genValid
diff --git a/test/Data/UUID/TypedSpec.hs b/test/Data/UUID/TypedSpec.hs
new file mode 100644
index 0000000..46c2063
--- /dev/null
+++ b/test/Data/UUID/TypedSpec.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE TypeApplications #-}
+
+module Data.UUID.TypedSpec
+ ( spec
+ ) where
+
+import Test.Hspec
+import Test.Validity
+import Test.Validity.Aeson
+
+import Data.GenValidity.UUID.Typed ()
+import Data.UUID.Typed
+
+spec :: Spec
+spec = do
+ eqSpec @(UUID Int)
+ genValidSpec @(UUID Int)
+ jsonSpec @(UUID Int)
diff --git a/test/Spec.hs b/test/Spec.hs
new file mode 100644
index 0000000..a824f8c
--- /dev/null
+++ b/test/Spec.hs
@@ -0,0 +1 @@
+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}