diff options
author | Ben Sima <ben@bsima.me> | 2020-04-07 22:07:07 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-04-08 20:01:25 -0700 |
commit | 751b725332fd0e9397b7cfd3f3a3bff14056c232 (patch) | |
tree | 5366cd49764aae99a4fcb7430d273f14cc4e4750 /Com/Simatime/Go.hs | |
parent | 8edc5c72a76ac227cac97bb39a15b194f618cc1c (diff) |
Return the app state as a simple dashboard
Diffstat (limited to 'Com/Simatime/Go.hs')
-rw-r--r-- | Com/Simatime/Go.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Com/Simatime/Go.hs b/Com/Simatime/Go.hs index bd9296a..e622539 100644 --- a/Com/Simatime/Go.hs +++ b/Com/Simatime/Go.hs @@ -7,6 +7,7 @@ Golang and Clojure's core.async. $example -} {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} module Com.Simatime.Go ( -- * Running and forking @@ -25,6 +26,7 @@ import Com.Simatime.Alpha hiding ( read ) import qualified Control.Concurrent as Concurrent import qualified Control.Concurrent.Chan.Unagi.Bounded as Chan +import qualified Data.Aeson as Aeson -- | A standard channel. data Channel a = Channel @@ -33,6 +35,9 @@ data Channel a = Channel , _size :: Int } +instance Aeson.ToJSON (Channel a) where + toJSON _ = Aeson.String ("#<channel>" :: Text) + -- | Starts a background process. fork :: IO () -> IO Concurrent.ThreadId fork = Concurrent.forkIO |