From abac581cf16425b4643e4f5196e5b8fd7d903cff Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 11 Oct 2017 22:04:30 +0300 Subject: Use TH for Process Factor it out. --- src/Application/Types/Process.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/Application/Types/Process.hs (limited to 'src/Application/Types/Process.hs') 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) -- cgit v1.2.3