The latest version of plugins-auto is 0.0.4-0.
plugins-auto
Version 0.0.2 revision 0 uploaded by FacundoDominguez.
Package meta
- Synopsis
- Automatic recompilation and reloading of haskell modules.
- Description
This library provides support for automatically recompiling and reloading modules into your programs when the source code is modified.
Any program called ghc in your PATH will be used for recompiling.
module Main where import System.IO (hSetBuffering,stdout,BufferMode(..)) import System.Plugins.Auto (withMonadIO,initPlugins) import Answer main :: IO () main = do ph<-initPlugins hSetBuffering stdout NoBuffering putStrLn "This program interacts with you in a loop." putStrLn "Type something, and the program will respond when you hit the Enter Key." putStrLn "Modify Answer.hs while interacting and you should see the answers" putStrLn "change accordingly." let interactiveLoop = prompt ph >> interactiveLoop interactiveLoop where prompt ph = do putStr "> " input <- getLine $(withMonadIO 'getAnswer) ph id notLoaded$ \errs getAnswer -> mapM_ putStrLn errs >> getAnswer input notLoaded errs = if null errs then putStrLn "Plugin not loaded yet." else putStrLn "Errors found:" >> mapM_ (putStrLn . (" "++)) errs >> putStrLn "Try fixing the errors and come back here."
module Answer where getAnswer :: String -> IO () getAnswer input = putStrLn ("What you typed: "++input)
- Author
- Happstack team, HAppS LLC
- Bug reports
- n/a
- Category
- System
- Copyright
- n/a
- Homepage
- n/a
- Maintainer
- Happstack team <happs@googlegroups.com>
- Package URL
- n/a
- Stability
- n/a