module HNormalise.Lmod.Json where
import Data.Aeson
import Data.Monoid
import HNormalise.Lmod.Internal
instance ToJSON LmodInfo where
toEncoding (LmodInfo username cluster jobid) =
pairs
( "username" .= username
<> "cluster" .= cluster
<> "jobid" .= jobid
)
instance ToJSON LmodLoad where
toEncoding (LmodLoad info userload modul filename) =
pairs
( "info" .= info
<> "userload" .= userload
<> "module" .= modul
<> "filename" .= filename
)
instance ToJSON LmodModule where
toEncoding (LmodModule name version) =
pairs
( "name" .= name
<> "version" .= version
)