git.iko.soy/typeable/country-codes
on master help sign in
Add an NFData instance to CountryCode
f22f6caAva Pek
country-codes.cabal+1
@@ -30,6 +30,7 @@ library
30 base >= 4 && < 5
30 base >= 4 && < 5
31 , text >= 0.11
31 , text >= 0.11
32 , aeson >= 0.5
32 , aeson >= 0.5
33+ , deepseq >= 1.4
33 , shakespeare == 2.0.*
34 , shakespeare == 2.0.*
34 ghc-options: -Wall
35 ghc-options: -Wall
35 other-modules: Data.CountryCodes.ISO31661
36 other-modules: Data.CountryCodes.ISO31661
src/Data/CountryCodes/ISO31661.hs+5−1
@@ -13,10 +13,11 @@ module Data.CountryCodes.ISO31661 (
13) where
13) where
14
14
15import Control.Applicative (pure)
15import Control.Applicative (pure)
16+import Control.DeepSeq (NFData(..))
16import Data.Aeson
17import Data.Aeson
17import Data.Typeable
18import Data.Typeable
18import qualified Data.Text as T
19import qualified Data.Text as T
19−import Prelude (Show,Read,Eq,Ord,Bounded,Enum,error,($),(++),Maybe(..),(.),fail)
20+import Prelude (Show,Read,Eq,Ord,Bounded,Enum,error,($),(++),Maybe(..),(.),fail,seq)
20import Text.Shakespeare.I18N
21import Text.Shakespeare.I18N
21
22
22data CountryCode =
23data CountryCode =
@@ -1560,3 +1561,6 @@ instance FromJSON CountryCode where
1560instance RenderMessage master CountryCode where
1561instance RenderMessage master CountryCode where
1561 renderMessage _ _ = toName
1562 renderMessage _ _ = toName
1562
1563
1564+-- | Allow the deep evaluation of CountryCode with `deepseq`
1565+instance NFData CountryCode where
1566+ rnf a = a `seq` ()