git.iko.soy/typeable/country-codes
on master help sign in
Merge pull request #6 from exodrifter/master

Add an NFData instance to CountryCode

commit5c888223d66dc4c20c33011e0aabc585341fa8ef authorFelipe Lessa <felipe.lessa@gmail.com> dateTue 12 Feb 2019, 08:11 (8 years ago) parent3cd2760f22f6ca
2 files changed+6−1
country-codes.cabal+1 src/Data/CountryCodes/ISO31661.hs+5−1
country-codes.cabal+1
@@ -30,6 +30,7 @@ library
3030 base >= 4 && < 5
3131 , text >= 0.11
3232 , aeson >= 0.5
33+ , deepseq >= 1.4
3334 , shakespeare == 2.0.*
3435 ghc-options: -Wall
3536 other-modules: Data.CountryCodes.ISO31661
src/Data/CountryCodes/ISO31661.hs+5−1
@@ -13,10 +13,11 @@ module Data.CountryCodes.ISO31661 (
1313) where
1414
1515import Control.Applicative (pure)
16+import Control.DeepSeq (NFData(..))
1617import Data.Aeson
1718import Data.Typeable
1819import 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)
2021import Text.Shakespeare.I18N
2122
2223data CountryCode =
@@ -1560,3 +1561,6 @@ instance FromJSON CountryCode where
15601561instance RenderMessage master CountryCode where
15611562 renderMessage _ _ = toName
15621563
1564+-- | Allow the deep evaluation of CountryCode with `deepseq`
1565+instance NFData CountryCode where
1566+ rnf a = a `seq` ()