essence-of-live-coding-0.2.6: General purpose live coding framework
Safe HaskellNone
LanguageHaskell2010

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

Documentation

data NoStore Source #

An exception type marking the absence of a foreign store of the correct type.

Constructors

NoStore 

Instances

Instances details
Show NoStore Source # 
Instance details

Defined in LiveCoding.GHCi

Exception NoStore Source # 
Instance details

Defined in LiveCoding.GHCi

Retrieving launched programs from the foreign store

possiblyLaunchedProgram :: Launchable m => Proxy m -> IO (Either SomeException (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.

livestop :: Monad m => p -> m [Char] Source #

Stop the program.