dev-haskell/plugins-auto (haskell)

Search

Package Information

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)
Homepage:
https://hackage.haskell.org/package/plugins-auto
License:
BSD

Versions

Version EAPI Keywords Slot
0.0.4 8 ~amd64 0/0.0.4

Metadata

Description

Maintainers

Raw Metadata XML
<pkgmetadata>
	<maintainer type="project">
		<email>haskell@gentoo.org</email>
		<name>Gentoo Haskell</name>
	</maintainer>
	<longdescription>
		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.
		
		&gt; module Main where
		&gt; import System.IO           (hSetBuffering,stdout,BufferMode(..))
		&gt; import System.Plugins.Auto (withMonadIO,initPlugins)
		&gt; import Answer
		&gt;
		&gt; main :: IO ()
		&gt; main = do ph&lt;-initPlugins
		&gt;         hSetBuffering stdout NoBuffering
		&gt;         putStrLn "This program interacts with you in a loop."
		&gt;         putStrLn "Type something, and the program will respond when you hit the Enter Key."
		&gt;         putStrLn "Modify Answer.hs while interacting and you should see the answers"
		&gt;         putStrLn "change accordingly."
		&gt;         let interactiveLoop = prompt ph &gt;&gt; interactiveLoop
		&gt;         interactiveLoop
		&gt; where
		&gt;   prompt ph = do
		&gt;      putStr "&gt; "
		&gt;      input &lt;- getLine
		&gt;      $(withMonadIO 'getAnswer) ph id notLoaded$ \errs getAnswer -&gt;
		&gt;          mapM_ putStrLn errs  &gt;&gt; getAnswer input
		&gt;
		&gt;   notLoaded errs =
		&gt;      if null errs then putStrLn "Plugin not loaded yet."
		&gt;        else putStrLn "Errors found:" &gt;&gt; mapM_ (putStrLn . ("  "++)) errs
		&gt;               &gt;&gt; putStrLn "Try fixing the errors and come back here."
		
		&gt; module Answer where
		&gt;
		&gt; getAnswer :: String -&gt; IO ()
		&gt; getAnswer input = putStrLn ("What you typed: "++input)
	</longdescription>
</pkgmetadata>

Lint Warnings

Files

Manifest

Type File Size Versions
DIST plugins-auto-0.0.4.tar.gz 8736 bytes 0.0.4
Unmatched Entries
Type File Size