From 7bdf16be84b368655ce2ee3d9ab6bf185dfb59b5 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 11 Jan 2024 03:20:56 +0100 Subject: chore: make computing `probabilityMap` more performance --- tags/src/Tag.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tags/src') 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 -- cgit v1.2.3