git.iko.soy/typeable/country-codes
on master help sign in
cleanup frontend dependencies
commitcc81315a12fd6f7415314741eeb04c6527715497 authorodr <dima@typeable.io> dateFri 16 May 2025, 17:08 (1 year ago) parentd7ab75d
2 files changed+17−6
country-codes.cabal+6−3 src/Data/CountryCodes/ISO31661.hs+11−3
country-codes.cabal+6−3
@@ -31,11 +31,14 @@ library
3131 , text >= 0.11
3232 , aeson >= 0.5
3333 , deepseq >= 1.4
34− , generic-arbitrary
3534 , shakespeare
3635 -- == 2.0.*
37− , openapi3
38− , QuickCheck
36+ if !(impl(ghcjs) || arch(javascript))
37+ build-depends:
38+ openapi3
39+ , QuickCheck
40+ , generic-arbitrary
41+ cpp-options: -DBACKEND
3942 ghc-options: -Wall
4043 other-modules: Data.CountryCodes.ISO31661
4144 exposed-modules: Data.CountryCodes
src/Data/CountryCodes/ISO31661.hs+11−3
@@ -1,6 +1,6 @@
11{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, NoImplicitPrelude
22 , DeriveGeneric, DeriveAnyClass, PatternGuards, FlexibleInstances
3− , MultiParamTypeClasses, StandaloneDeriving #-}
3+ , MultiParamTypeClasses, StandaloneDeriving, CPP #-}
44{-# OPTIONS_GHC -fconstraint-solver-iterations=10 #-}
55-- | This file is generated from the Wikipedia page
66-- <http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>
@@ -20,12 +20,14 @@ import Control.DeepSeq (NFData(..))
2020import Data.Aeson
2121import Data.Typeable
2222import Data.Text as T
23−import Data.OpenApi
2423import GHC.Generics
2524import Prelude (Show,Read,Eq,Ord,Bounded,Enum,error,($),(++),Maybe(..),(.),fail,seq)
2625import Text.Shakespeare.I18N
26+#ifdef BACKEND
27+import Data.OpenApi
2728import Test.QuickCheck.Arbitrary
2829import Test.QuickCheck.Arbitrary.Generic
30+#endif
2931
3032data CountryCode =
3133 AD
@@ -285,7 +287,11 @@ data CountryCode =
285287 | XK
286288 | XC
287289 | WE
288− 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+ )
289295
290296-- | Maybe get the CountryCode from the text code.
291297fromMText :: T.Text -> Maybe CountryCode
@@ -1609,6 +1615,8 @@ instance RenderMessage master CountryCode where
16091615instance NFData CountryCode where
16101616 rnf a = a `seq` ()
16111617
1618+#ifdef BACKEND
16121619instance Arbitrary CountryCode where
16131620 arbitrary = genericArbitrary
16141621 shrink = genericShrink
1622+#endif