Skip to content

Commit

Permalink
indentation is good in whitespace-sensitive languages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jassob committed Sep 27, 2023
1 parent adb2821 commit f35bc3c
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,18 @@ main =
, webserver config viewRef upd
, updater mgr upd refreshAction
]
where
timer upd = forever $ tryPutMVar upd () >> threadDelay (view cInterval config)
where
timer upd = forever $ tryPutMVar upd () >> threadDelay (view cInterval config)

updater mgr upd refreshAction =
forever
$ withFDHandler defaultBatchingOptions stdout 1.0 80
$ \logCallback ->
runLoggingT
(runReaderT (refreshAction upd) (ClientContext config mgr))
(logCallback . renderWithTimestamp
(formatTime defaultTimeLocale (iso8601DateFormat (Just "%H:%M:%S")))
id
)
updater mgr upd refreshAction = forever
$ withFDHandler defaultBatchingOptions stdout 1.0 80
$ \logCallback ->
runLoggingT
(runReaderT (refreshAction upd) (ClientContext config mgr))
(logCallback . renderWithTimestamp
(formatTime defaultTimeLocale (iso8601DateFormat (Just "%H:%M:%S")))
id
)

webserver
:: Config
Expand All @@ -114,4 +113,3 @@ webserver conf viewRef upd = scotty (view cPort conf) $ do
middleware (static $(embedDir "static"))
get "/" ((html . render) =<< liftIO (readIORef viewRef))
get "/r" (liftIO (tryPutMVar upd ()) >> redirect "/") -- force update

0 comments on commit f35bc3c

Please sign in to comment.