mirror of
https://github.com/typeable/country-codes.git
synced 2024-10-03 17:07:46 +03:00
Add Arbitrary instance
This commit is contained in:
parent
a85df94fc3
commit
05d68730f2
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user