diff options
Diffstat (limited to 'tags')
-rw-r--r-- | tags/src/Tag.hs | 4 | ||||
-rw-r--r-- | tags/tags.cabal | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/tags/src/Tag.hs b/tags/src/Tag.hs index f7f3398..882f1de 100644 --- a/tags/src/Tag.hs +++ b/tags/src/Tag.hs @@ -51,6 +51,7 @@ module Tag where import Control.Applicative ((<|>)) +import Control.DeepSeq (NFData (rnf)) import Data.Aeson qualified as J import Data.Attoparsec.Text qualified as A import Data.Binary (Binary) @@ -66,6 +67,9 @@ import TypedValue (cast, castDef) data Tag = Tag T.Text (Maybe T.Text) deriving (Show, Generic, Binary, Eq, Ord) +instance NFData Tag where + rnf (Tag k v) = rnf k `seq` rnf v + tag :: T.Text -> Maybe T.Text -> Tag tag = Tag diff --git a/tags/tags.cabal b/tags/tags.cabal index 0149e74..c93aedd 100644 --- a/tags/tags.cabal +++ b/tags/tags.cabal @@ -26,7 +26,8 @@ library containers, regex, text, - time + time, + deepseq hs-source-dirs: src default-language: GHC2021 default-extensions: |