leancheck-enum-instances (empty) → 0.1.0.0
raw patch · 5 files changed
+109/−0 lines, 5 filesdep +basedep +enum-typesdep +leanchecksetup-changed
Dependencies added: base, enum-types, leancheck
Files
- LICENSE +30/−0
- README.md +5/−0
- Setup.hs +2/−0
- leancheck-enum-instances.cabal +32/−0
- src/Test/LeanCheck/Instances/Enum.hs +40/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Andrew Martin (c) 2018++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Andrew Martin nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,5 @@+# leancheck-enum-instances++This library provides orphan instances for several small enumeration types.+These give the user fine-grained control of how many inhabitants a type+has.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ leancheck-enum-instances.cabal view
@@ -0,0 +1,32 @@+cabal-version: 2.0+name: leancheck-enum-instances+version: 0.1.0.0+description:+ Instances of the `Listable` typeclass for all of the types+ in `enum-types`. These are orphan instances, so this should+ only be used in test suites.+homepage: https://github.com/andrewthad/leancheck-enum-instances+bug-reports: https://github.com/andrewthad/leancheck-enum-instances/issues+author: Andrew Martin+maintainer: andrew.thaddeus@gmail.com+copyright: 2018 Andrew Martin+license: BSD3+license-file: LICENSE+build-type: Simple+extra-source-files: README.md+category: Testing+synopsis: listable instances for small enum types++source-repository head+ type: git+ location: https://github.com/andrewthad/quickcheck-enum-instances++library+ exposed-modules: Test.LeanCheck.Instances.Enum+ hs-source-dirs: src+ build-depends:+ base >= 4.9.1.0 && < 5+ , enum-types >= 0.1+ , leancheck >= 0.7.7+ default-language: Haskell2010+
+ src/Test/LeanCheck/Instances/Enum.hs view
@@ -0,0 +1,40 @@+{-# language TypeApplications #-}++module Test.LeanCheck.Instances.Enum () where++import Data.Enum.Types+import Test.LeanCheck (Listable(tiers),(\/),cons0)++instance Listable A where+ tiers = cons0 A0++instance Listable B where+ tiers = cons0 B0 \/ cons0 B1++instance Listable C where+ tiers = cons0 C0 \/ cons0 C1 \/ cons0 C2++instance Listable D where+ tiers = cons0 D0 \/ cons0 D1 \/ cons0 D2 \/ cons0 D3++instance Listable E where+ tiers = cons0 E0 \/ cons0 E1 \/ cons0 E2 \/ cons0 E3 \/ cons0 E4++instance Listable F where+ tiers = cons0 F0 \/ cons0 F1 \/ cons0 F2 \/ cons0 F3 \/ cons0 F4 \/ cons0 F5++instance Listable G where+ tiers = cons0 G0 \/ cons0 G1 \/ cons0 G2 \/ cons0 G3 \/ cons0 G4 \/ cons0 G5 \/ cons0 G6++instance Listable H where+ tiers = cons0 H0 \/ cons0 H1 \/ cons0 H2 \/ cons0 H3 \/ cons0 H4 \/ cons0 H5 \/ cons0 H6 \/ cons0 H7++instance Listable I where+ tiers = cons0 I0 \/ cons0 I1 \/ cons0 I2 \/ cons0 I3 \/ cons0 I4 \/ cons0 I5 \/ cons0 I6 \/ cons0 I7 \/ cons0 I8++instance Listable J where+ tiers = cons0 J0 \/ cons0 J1 \/ cons0 J2 \/ cons0 J3 \/ cons0 J4 \/ cons0 J5 \/ cons0 J6 \/ cons0 J7 \/ cons0 J8 \/ cons0 J9++instance Listable K where+ tiers = cons0 K0 \/ cons0 K1 \/ cons0 K2 \/ cons0 K3 \/ cons0 K4 \/ cons0 K5 \/ cons0 K6 \/ cons0 K7 \/ cons0 K8 \/ cons0 K9 \/ cons0 K10+