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/Types.hs | |
parent | 252a4a3e1553295ffafbfa5150306f0f31dda8cd (diff) |
sprinkle some NFData everywhere
(also some evaluateNF, leading to slightly less memory usage)
Diffstat (limited to '')
-rw-r--r-- | lib/Types.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Types.hs b/lib/Types.hs index 588c8ea..43a5131 100644 --- a/lib/Types.hs +++ b/lib/Types.hs @@ -24,6 +24,7 @@ import Data.Text (Text) import GHC.Generics (Generic) import Badges (Badge) +import Control.DeepSeq (NFData) import qualified Data.Aeson as A import Data.Maybe (mapMaybe) import Paths (RelPath) @@ -37,7 +38,7 @@ import WithCli.Pure (Argument (argumentType, parseArgumen -- | Levels of errors and warnings, collectively called -- "Hints" until I can think of some better name data Level = Info | Suggestion | Warning | Forbidden | Error | Fatal - deriving (Show, Generic, Ord, Eq, ToJSON, FromJSON) + deriving (Show, Generic, Ord, Eq, ToJSON, FromJSON, NFData) instance Argument Level where argumentType Proxy = "Lint Level" @@ -60,12 +61,12 @@ data Lint = Depends Dep | Offers Text | Lint Hint | Badge Badge deriving (Ord, Eq, Generic, ToJSONKey) data Dep = Local RelPath | Link Text | MapLink Text | LocalMap RelPath - deriving (Generic, Ord, Eq) + deriving (Generic, Ord, Eq, NFData) data Hint = Hint { hintLevel :: Level , hintMsg :: Text - } deriving (Generic, Ord, Eq) + } deriving (Generic, Ord, Eq, NFData) -- | shorter constructor (called hint because (a) older name and -- (b) lint also exists and is monadic) |