diff options
author | stuebinm | 2022-02-17 00:41:36 +0100 |
---|---|---|
committer | stuebinm | 2022-02-17 00:41:36 +0100 |
commit | faa244e1a7e760be88054a5f15b3e115ad8e32e5 (patch) | |
tree | 34cec7b74b49284f446aaf3073a551306d8ca5be /lib/Paths.hs | |
parent | 487e06bf875ba8a835399b26095c756899b1209f (diff) |
sprinkle some NFData everywhere
(also some evaluateNF, leading to slightly less memory usage)
Diffstat (limited to '')
-rw-r--r-- | lib/Paths.hs | 6 |
1 files changed, 5 insertions, 1 deletions
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) |