diff options
author | stuebinm | 2022-02-17 00:41:36 +0100 |
---|---|---|
committer | stuebinm | 2022-03-19 19:29:16 +0100 |
commit | 53fb449b008e9b6aed9877b9d33f4026e454e0f9 (patch) | |
tree | 1b95b0d7607426c66bd6173e0f1ff8c97a7b6541 /lib/Paths.hs | |
parent | 252a4a3e1553295ffafbfa5150306f0f31dda8cd (diff) |
sprinkle some NFData everywhere
(also some evaluateNF, leading to slightly less memory usage)
Diffstat (limited to 'lib/Paths.hs')
-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) |