aboutsummaryrefslogtreecommitdiff
path: root/lib/Server/Util.hs
diff options
context:
space:
mode:
authorstuebinm2022-07-03 00:21:25 +0200
committerstuebinm2022-07-03 00:21:25 +0200
commitb4f267ce14c753e952508e6313eec0ff9a99a879 (patch)
tree7baf38a8212b4c5959c5a592a767198187f96490 /lib/Server/Util.hs
parent0197560d9d9ea6ac95146906964fc2408fbf1a31 (diff)
add service monad (with built-in logging)
Diffstat (limited to 'lib/Server/Util.hs')
-rw-r--r--lib/Server/Util.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Server/Util.hs b/lib/Server/Util.hs
new file mode 100644
index 0000000..45c2477
--- /dev/null
+++ b/lib/Server/Util.hs
@@ -0,0 +1,13 @@
+
+
+-- | mostly the monad the service runs in
+module Server.Util (Service, ServiceM, runService) where
+
+import Control.Monad.Logger (LoggingT, runStderrLoggingT)
+import Servant (Handler, ServerT)
+
+type ServiceM = LoggingT Handler
+type Service api = ServerT api ServiceM
+
+runService :: ServiceM a -> Handler a
+runService = runStderrLoggingT