{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE GADTs #-} import Control.Applicative import Control.Concurrent import Control.Concurrent.STM import qualified Control.Exception as E import Control.Monad (forever, foldM, void) import Data.Aeson import Data.Monoid((<>)) import qualified Data.Text.Lazy as T import Network.JavaScript as JS import Network.Wai.Middleware.RequestLogger import System.Exit import Web.Scotty hiding (delete, function) import Data.Time.Clock main = main_ 3000 main_ :: Int -> IO () main_ i = do lock <- newEmptyMVar void $ forkIO $ scotty i $ do -- middleware $ logStdout middleware $ start $ \ e -> example e `E.finally` (do putMVar lock () putStrLn "Finished example") get "/" $ do html $ mconcat $ [ "" , "" , "
" , "" , "" , "" , "" , "" , "Groups
Tests
Applicative
Monad