From 53fb449b008e9b6aed9877b9d33f4026e454e0f9 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 17 Feb 2022 00:41:36 +0100 Subject: sprinkle some NFData everywhere (also some evaluateNF, leading to slightly less memory usage) --- lib/Paths.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Paths.hs') diff --git a/lib/Paths.hs b/lib/Paths.hs index b9b0d50..15dc66b 100644 --- a/lib/Paths.hs +++ b/lib/Paths.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} @@ -5,8 +7,10 @@ -- I just hope you are running this on some kind of Unix module Paths where +import Control.DeepSeq (NFData) import Data.Text (Text, isPrefixOf) import qualified Data.Text as T +import GHC.Generics (Generic) import System.FilePath (splitPath) import System.FilePath.Posix (()) import Text.Regex.TDFA @@ -16,7 +20,7 @@ import Util (PrettyPrint (prettyprint)) -- a path without any . or .. in it. Also possibly a -- fragment, mostly for map links. data RelPath = Path Int Text (Maybe Text) - deriving (Show, Eq, Ord) + deriving (Show, Eq, Ord, NFData, Generic) -- cgit v1.2.3