Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add DevelMain support
- Loading branch information
Showing
5 changed files
with
77 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
((haskell-mode . ((haskell-process-type . cabal-repl) | ||
(haskell-process-use-ghci . t))) | ||
(css-mode . ((haskell-process-use-ghci . t)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
-- | Main entry point to tryhaskell. | ||
-- | ||
-- Try Haskell! | ||
|
||
module DevelMain where | ||
|
||
import Control.Concurrent | ||
import Control.Exception | ||
import Foreign.Store | ||
import TryHaskell | ||
|
||
-- | Main entry point. | ||
main :: IO () | ||
main = | ||
do ((stats,statsT),(cache,cacheT)) <- setupServer | ||
tid <- forkIO (finally (startServer cache stats) | ||
(do killThread statsT | ||
killThread cacheT)) | ||
putStrLn ("Writing store with " ++ show tid ++ " ...") | ||
writeStore (Store 0) tid | ||
|
||
-- | Update the running server. | ||
update :: IO () | ||
update = | ||
do m <- lookupStore 0 | ||
case m of | ||
Nothing -> do putStrLn "Starting fresh ..." | ||
main | ||
Just s -> | ||
do tid <- readStore s | ||
putStrLn ("Killing thread " ++ show tid) | ||
killThread tid | ||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters