@@ -1,6 +1,7 @@
11{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, NoImplicitPrelude
22 , DeriveGeneric, DeriveAnyClass, PatternGuards, FlexibleInstances
3− , MultiParamTypeClasses, StandaloneDeriving #-}
3+ , MultiParamTypeClasses, StandaloneDeriving, CPP #-}
4+{-# OPTIONS_GHC -fconstraint-solver-iterations=10 #-}
45-- | This file is generated from the Wikipedia page
56-- <http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>
67module Data.CountryCodes.ISO31661 (
@@ -19,10 +20,14 @@ import Control.DeepSeq (NFData(..))
1920import Data.Aeson
2021import Data.Typeable
2122import Data.Text as T
22−import Data.OpenApi
2323import GHC.Generics
2424import Prelude (Show,Read,Eq,Ord,Bounded,Enum,error,($),(++),Maybe(..),(.),fail,seq)
2525import Text.Shakespeare.I18N
26+#ifdef BACKEND
27+import Data.OpenApi
28+import Test.QuickCheck.Arbitrary
29+import Test.QuickCheck.Arbitrary.Generic
30+#endif
2631
2732data CountryCode =
2833 AD
@@ -282,7 +287,11 @@ data CountryCode =
282287 | XK
283288 | XC
284289 | WE
285− deriving (Show,Read,Eq,Ord,Bounded,Enum,Typeable, Generic, ToSchema)
290+ deriving (Show,Read,Eq,Ord,Bounded,Enum,Typeable, Generic
291+#ifdef BACKEND
292+ , ToSchema
293+#endif
294+ )
286295
287296-- | Maybe get the CountryCode from the text code.
288297fromMText :: T.Text -> Maybe CountryCode
@@ -1605,3 +1614,9 @@ instance RenderMessage master CountryCode where
16051614-- | Allow the deep evaluation of CountryCode with `deepseq`
16061615instance NFData CountryCode where
16071616 rnf a = a `seq` ()
1617+
1618+#ifdef BACKEND
1619+instance Arbitrary CountryCode where
1620+ arbitrary = genericArbitrary
1621+ shrink = genericShrink
1622+#endif