plugins-auto: Automatic recompilation and reloading of haskell modules.

[ bsd3, library, system ] [ Propose Tags ] [ Report a vulnerability ]

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 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)

Modules

  • System
    • Plugins
      • System.Plugins.Auto

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.0.2, 0.0.3, 0.0.4
Dependencies base (>=3 && <5), containers, filepath, hinotify (>=0.3.2), mtl, plugins (>=1.5.1.4), template-haskell [details]
License BSD-3-Clause
Author Happstack team, HAppS LLC and MarketPsych Advisor LLC
Maintainer Happstack team <happs@googlegroups.com>
Category System
Source repo head: darcs get http://patch-tag.com/r/facundo/plugins-auto
this: darcs get http://patch-tag.com/r/facundo/plugins-auto --tag 0.0.4
Uploaded by FacundoDominguez at 2011-12-15T00:05:10Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 3142 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-12-26 [all 8 reports]