Add Arbitrary instance

This commit is contained in:
Dmitry Olshansky 2022-04-02 12:47:54 +03:00
parent a85df94fc3
commit 05d68730f2
3 changed files with 12 additions and 0 deletions

View File

@ -31,8 +31,10 @@ library
, text >= 0.11
, aeson >= 0.5
, deepseq >= 1.4
, generic-arbitrary
, shakespeare == 2.0.*
, openapi3
, QuickCheck
ghc-options: -Wall
other-modules: Data.CountryCodes.ISO31661
exposed-modules: Data.CountryCodes

View File

@ -1,6 +1,7 @@
{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, NoImplicitPrelude
, DeriveGeneric, DeriveAnyClass, PatternGuards, FlexibleInstances
, MultiParamTypeClasses, StandaloneDeriving #-}
{-# OPTIONS_GHC -fconstraint-solver-iterations=10 #-}
-- | This file is generated from the Wikipedia page
-- <http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>
module Data.CountryCodes.ISO31661 (
@ -23,6 +24,8 @@ import Data.OpenApi
import GHC.Generics
import Prelude (Show,Read,Eq,Ord,Bounded,Enum,error,($),(++),Maybe(..),(.),fail,seq)
import Text.Shakespeare.I18N
import Test.QuickCheck.Arbitrary
import Test.QuickCheck.Arbitrary.Generic
data CountryCode =
AD
@ -1605,3 +1608,7 @@ instance RenderMessage master CountryCode where
-- | Allow the deep evaluation of CountryCode with `deepseq`
instance NFData CountryCode where
rnf a = a `seq` ()
instance Arbitrary CountryCode where
arbitrary = genericArbitrary
shrink = genericShrink

View File

@ -7,3 +7,6 @@ extra-deps:
- git: https://github.com/typeable/openapi3.git
# nix-sha256: 1aqn5dia4aqwpmr3v0rcb8kzhknp5674hhay8h7p76206dx83ykg
commit: bb1c64f8501535143c92907166fdc9f8df6d51b9
- git: https://github.com/typeable/generic-arbitrary.git
# nix-sha256: 01k87zxa8cd5ssy1wiqwyqqvz4v7lvh3q6cipmadg4w2ynmfbdn0
commit: 84c62a4de517c78e5080f5451714ce7944987ba6