-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Develop applications without restarts
--   
--   Please see the README on Github at
--   <a>https://github.com/rkaippully/starter#readme</a>
@package starter
@version 0.2.1


-- | Server side software development usually needs frequent restarts. You
--   would launch a server, make code changes, recompile the code, and then
--   restart the server. Starter attempts to automate this tedious cycle.
--   
--   <h1>How does it work?</h1>
--   
--   Starter is a library that you link to your program. With a few simple
--   steps, you can set up a GHCi session that automatically reloads your
--   program whenever your source code changes.
--   
--   <ol>
--   <li>In some module of your program (e.g. <tt>MyModule</tt>), define a
--   variable <tt>mySettings</tt> of type <a>StarterSettings</a>.</li>
--   <li>Define a function <tt>runDevMode = runStarter
--   mySettings</tt>.</li>
--   <li>Create a <tt>.ghci</tt> file in your project with the following
--   contents:<pre>:load MyModule Starter :def! starter runDevMode
--   </pre></li>
--   <li>Now you can start your program with the <tt>:starter</tt> command.
--   This will run your program under a monitor. When the source code
--   changes, the monitor will interrupt the program with an exception,
--   reload the modules with a <tt>:reload</tt> command and restart the
--   program.</li>
--   <li>You can terminate the session with a Ctrl+C.</li>
--   </ol>
module Starter
data StarterSettings
StarterSettings :: (String -> IO ()) -> String -> String -> (FilePath -> Bool) -> StarterSettings

-- | The program to be run by starter. The command line arguments passed to
--   the GHCi command will be passed to this function.
[starterProgram] :: StarterSettings -> String -> IO ()

-- | The GHCi command name
[starterCommand] :: StarterSettings -> String

-- | The expression that should be bound to the GHCi command. For e.g., if
--   you created a <tt>.ghci</tt> file with the command <tt>:def! starter
--   runDevMode</tt>, then this should be set to <tt>runDevMode</tt>.
[starterCommandExpression] :: StarterSettings -> String

-- | Predicate to determine if the program should be restarted on change of
--   a file.
[starterIsRestartable] :: StarterSettings -> FilePath -> Bool

-- | Default <a>StarterSettings</a> that uses ":starter" as the GHCi
--   command and restarts on all file changes.
defaultStarterSettings :: StarterSettings

-- | Run a program under a monitor for source code changes. The
--   <a>StarterSettings</a> argument contains details about what needs to
--   be run and how the monitor behaves. The second argument is the command
--   line passed to the GHCi command from the GHCi session. For e.g, if you
--   start the program with:
--   
--   <pre>
--   :starter foo bar
--   </pre>
--   
--   then "foo bar" will be passed as the second argument to
--   <tt>runStarter</tt>.
runStarter :: StarterSettings -> String -> IO String
