aboutsummaryrefslogtreecommitdiff
path: root/src/Application
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-10-11 22:04:30 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-10-11 22:04:30 +0300
commitabac581cf16425b4643e4f5196e5b8fd7d903cff (patch)
tree6d076a434ab76c4c48d36ebd9f55a95487fbb46a /src/Application
parent65b71a99fdb60ad063cb7e8976143027b1e260e7 (diff)
downloadmywatch-abac581cf16425b4643e4f5196e5b8fd7d903cff.tar.gz
Use TH for Process
Factor it out.
Diffstat (limited to 'src/Application')
-rw-r--r--src/Application/Types/Process.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Application/Types/Process.hs b/src/Application/Types/Process.hs
new file mode 100644
index 0000000..2156241
--- /dev/null
+++ b/src/Application/Types/Process.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module Application.Types.Process
+ ( Process(..)
+ ) where
+
+import Prelude hiding (id)
+
+import Data.Aeson.TH (defaultOptions, deriveToJSON)
+import Data.Text.Lazy (Text)
+
+data Process = Process
+ { id :: Int
+ , user :: Text
+ , host :: Text
+ , db :: Maybe Text
+ , command :: Text
+ , time :: Int
+ , state :: Maybe Text
+ , info :: Text
+ }
+
+$(deriveToJSON defaultOptions ''Process)