-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | IRC friendly REPL library.
--
-- Similar to mueval, but using a server with the GHC API instead of a
-- command-line tool. As a result, it is much faster than mueval.
-- Additionally, repl supports declarations/bindings (and deleting them),
-- type and kind pretty printing, in addition to expression evaluation.
@package repl
@version 1.1
module Language.Haskell.Repl
data Repl a
-- | Default GHCi-like Repl
newRepl :: IO (Repl [String])
-- | Repl smart constructor.
repl' :: Chan Input -> Chan (ReplOutput a) -> [String] -> [String] -> (String -> String) -> (Dynamic -> IO a) -> Double -> Int -> IO (Repl a)
defaultFlags :: [String]
defaultImports :: [String]
-- | defaultLineLength = 512
defaultLineLength :: Int
-- | defaultPatience = 5
defaultPatience :: Double
defaultBuildExpr :: String -> String
defaultProcessOutput :: Dynamic -> IO [String]
stopRepl :: Repl a -> IO ()
data Input
Type :: String -> Input
Kind :: String -> Input
Info :: String -> Input
Decl :: String -> Input
Stmt :: String -> Input
Expr :: String -> Input
Undefine :: String -> Input
Clear :: Input
data ReplOutput a
ReplError :: String -> ReplOutput a
GhcError :: String -> ReplOutput a
Output :: [String] -> ReplOutput a
Result :: a -> ReplOutput a
data Output
OK :: [String] -> Output
Exception :: [String] -> String -> Output
Errors :: [String] -> Output
Partial :: [String] -> Output
Timeout :: [String] -> Output
-- | Same as prompt_, except it parses the input, and pretty prints
-- the results.
prompt :: Repl [String] -> String -> IO [String]
-- | Enter commands and an expression to a Repl, and immediately
-- consume results. However, truncate input to the given length, and stop
-- the computation after the given amount of time in seconds.
prompt_ :: Repl [String] -> Input -> IO Output
-- | Send input.
send :: Repl a -> Input -> IO ()
-- | Naiively get the next set of results. This does not take into
-- account patiences, patienceForErrors, or
-- lineLength. However, due to laziness, this may not matter.
result :: Repl a -> IO (ReplOutput a)
-- | Used by prompt.
prettyOutput :: Repl a -> Output -> [String]
-- | Used by prompt
parseInput :: Parser Input
instance Show Input
instance Show a => Show (ReplOutput a)
instance Show Output