diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-01-11 03:20:56 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-01-11 03:26:52 +0100 |
commit | 7bdf16be84b368655ce2ee3d9ab6bf185dfb59b5 (patch) | |
tree | 3ee48fc98f98ab7ac7ad19e24334e07b8b147dd6 /tags | |
parent | 673c59d9be8b62106ffbba96d805680f0b5e7e3f (diff) |
chore: make computing `probabilityMap` more performance
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: |