| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
LiveCoding.GHCi
Description
Support functions to call common live coding functionalities like launching and reloading
from a ghci or cabal repl session.
You typically don't need to import this module in your code,
but you should load it in your interactive session,
ideally by copying the file `essence-of-live-coding/.ghci` to your project,
adjusting it to your needs and launching cabal repl.
Synopsis
- proxyFromLiveProgram :: LiveProgram m -> Proxy m
- possiblyLaunchedProgram :: Launchable m => Proxy m -> IO (Either SomeException (Maybe (LaunchedProgram m)))
- sync :: Launchable m => LiveProgram m -> IO ()
- launchAndSave :: Launchable m => LiveProgram m -> IO ()
- save :: Launchable m => LaunchedProgram m -> IO ()
- stopStored :: Launchable m => Proxy m -> IO ()
- liveinit :: Monad m => p -> m String
- livestep :: Monad m => p -> m [Char]
- livelaunch :: Monad m => p -> m [Char]
- livereload :: Monad m => p -> m String
- livestop :: Monad m => p -> m [Char]
Documentation
proxyFromLiveProgram :: LiveProgram m -> Proxy m Source #
Retrieving launched programs from the foreign store
possiblyLaunchedProgram :: Launchable m => Proxy m -> IO (Either SomeException (Maybe (LaunchedProgram m))) Source #
Try to retrieve a LiveProgram of a given type from the Store,
handling all IO exceptions.
Returns 'Right Nothing' if the store didn't exist.
sync :: Launchable m => LiveProgram m -> IO () Source #
Try to load a LiveProgram of a given type from the Store.
If the store doesn't contain a program, it is (re)started.
launchAndSave :: Launchable m => LiveProgram m -> IO () Source #
Launch a LiveProgram and save it in the Store.
save :: Launchable m => LaunchedProgram m -> IO () Source #
Save a LiveProgram to the store.
stopStored :: Launchable m => Proxy m -> IO () Source #
Try to retrieve a LaunchedProgram from the Store,
and if successful, stop it.
GHCi commands
Debugging
liveinit :: Monad m => p -> m String Source #
Initialise a launched program in the store, but don't start it.
livestep :: Monad m => p -> m [Char] Source #
Run one program step, assuming you have a launched program in a variable launchedProgram.
Running
livelaunch :: Monad m => p -> m [Char] Source #
Launch or restart a program and save its reference in the store.
livereload :: Monad m => p -> m String Source #
Reload the code and do hot code swap and migration.