{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} import Data.Function ((&)) import Data.Text (Text) import Effectful (runEff) import Effectful.Log (runLog) import Effectful.Reader.Static (runReader) import Effectful.Resource (runResource) import Hsm.Command.Command (commandStream) import Hsm.Command.Readline (runReadline) import Hsm.Core.App (launch) import Hsm.Core.Env (deriveFromYaml) import Hsm.Core.Zmq.Server (runServer, send) data Env = Env { name :: Text , pubEp :: Text } $(deriveFromYaml ''Env) main :: IO () main = launch @Env "command" id $ \env logger level -> (commandStream & send @Env) & runServer @Env & runLog env.name logger level & runReader env & runReadline & runResource & runEff