Safe Haskell | None |
---|
- data Repl
- newRepl :: IO Repl
- repl' :: [String] -> [ExtensionFlag] -> Chan Input -> Chan ReplOutput -> Maybe Double -> Maybe Int -> IO Repl
- defaultExtensions :: [ExtensionFlag]
- defaultImports :: [String]
- defaultLineLength :: Int
- defaultPatienceForResults :: Double
- stopRepl :: Repl -> IO ()
- data Input
- data ReplOutput
- data Output
- prompt :: Repl -> String -> IO [String]
- prompt_ :: Repl -> Input -> IO Output
- input :: Repl -> Input -> IO ()
- output :: Repl -> IO ReplOutput
- prettyOutput :: Output -> [String]
- parseInput :: Parser Input
Documentation
Construction
:: [String] | Imports, using normal Haskell import syntax |
-> [ExtensionFlag] | List of compiler extensions to use |
-> Chan Input | Input channel |
-> Chan ReplOutput | Output channel |
-> Maybe Double | Maximum time to wait for a result, in seconds (default: 5) |
-> Maybe Int | Maximum line length in |
-> IO Repl |
Repl
smart constructor.
Stopping
Interaction
prompt :: Repl -> String -> IO [String]Source
Same as prompt_
, except it parses the input, and pretty prints the results.
prompt_ :: Repl -> Input -> IO OutputSource
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.
output :: Repl -> IO ReplOutputSource
Naiively get the next set of results. This does not take into account
patienceForResults
, patienceForErrors
, or lineLength
. However, due
to laziness, this may not matter.
prettyOutput :: Output -> [String]Source
Used by prompt
.
parseInput :: Parser InputSource
Used by prompt