-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A Haskell pre-processor -- -- hpp is a Haskell pre-processor that is also a -- C89/C90-compatible pre-processor (with the addition of a -- --cpp flag). It is packaged as both a library and an -- executable. -- -- To use as a Haskell preprocessor for resolving #ifdef -- conditionals and simple macro expansion while still allowing -- multi-line string literals, an invocation might look like, -- --
-- hpp -DDEBUG Foo.hs ---- -- To use as a C preprocessor, an invocation might look like, -- --
-- hpp -DDEBUG --cpp foo.c ---- -- To have GHC use hpp as the C pre-processor, add this line to -- the top of a Haskell source file that makes use of the CPP -- LANGUAGE pragma. -- --
-- {-# OPTIONS_GHC -cpp -pgmPhpp -optP--cpp #-}
--
@package hpp
@version 0.3.0.0
-- | Tokenization breaks a String into pieces of whitespace,
-- constants, symbols, and identifiers.
module Hpp.Tokens
-- | Tokenization is words except the white space is tagged rather
-- than discarded.
data Token
-- | Identifiers, symbols, and constants
Important :: String -> Token
-- | White space, etc.
Other :: String -> Token
-- | Extract the contents of a Token.
detok :: Token -> String
-- | True if the given Token is Important;
-- False otherwise.
isImportant :: Token -> Bool
-- | True if the given Token is not Important;
-- False otherwise.
notImportant :: Token -> Bool
-- | Return the contents of only Important (non-space) tokens.
importants :: [Token] -> [String]
-- | Trim Other Tokens from both ends of a list of
-- Tokens.
trimUnimportant :: [Token] -> [Token]
-- | Is a Token a newline character?
newLine :: Token -> Bool
-- | Break a String into space and non-whitespace runs.
tokWords :: String -> [Token]
-- | If you encounter a string literal, call this helper with a
-- double-barreled continuation and the rest of your input. The
-- continuation will expect the remainder of the string literal as the
-- first argument, and the remaining input as the second argument.
skipLiteral :: ((String -> String) -> String -> r) -> String -> r
-- | splits isDelimiter str tokenizes str using
-- isDelimiter as a delimiter predicate. Leading whitespace is
-- also stripped from tokens.
splits :: (Char -> Bool) -> String -> [String]
-- | Predicate on space characters based on something approximating valid
-- identifier syntax. This is used to break apart non-space characters.
validIdentifierChar :: Char -> Bool
-- | Something like 12E+FOO is a single pre-processor token, so
-- FOO should not be macro expanded.
fixExponents :: [Token] -> [Token]
-- | Break an input String into a sequence of Tokens.
-- Warning: This may not exactly correspond to your target language's
-- definition of a valid identifier!
tokenize :: String -> [Token]
-- | Collapse a sequence of Tokens back into a String.
-- detokenize . tokenize == id.
detokenize :: [Token] -> String
instance GHC.Show.Show Hpp.Tokens.Token
instance GHC.Classes.Ord Hpp.Tokens.Token
instance GHC.Classes.Eq Hpp.Tokens.Token
-- | HELPERS for working with Strings
module Hpp.String
-- | Stringification puts double quotes around a string and backslashes
-- before existing double quote characters and backslash characters.
stringify :: String -> String
-- | Remove double quote characters from the ends of a string.
unquote :: String -> String
-- | Trim trailing spaces from a String
trimSpaces :: String -> String
-- | Similar to the function of the same name in the text package.
--
-- breakOn needle haystack finds the first instance of
-- needle in haystack. The first component of the
-- result is the prefix of haystack before needle is
-- matched. The second is the remainder of haystack, starting
-- with the match.
breakOn :: String -> String -> (String, String)
-- | Used to make switching to the text package easier.
cons :: a -> [a] -> [a]
-- | An expression language corresponding to the subset of C syntax that
-- may be used in preprocessor conditional directives. See
-- https://gcc.gnu.org/onlinedocs/cpp/If.html
module Hpp.Expr
-- | Expressions are literal values, binary operators applied to two
-- sub-expressions, or unary operators applied to a single
-- sub-expression.
data Expr
ELit :: Lit -> Expr
EBinOp :: BinOp -> Expr -> Expr -> Expr
EUnaryOp :: UnaryOp -> Expr -> Expr
-- | Read a literal integer. These may be decimal, octal, or hexadecimal,
-- and may have a case-insensitive suffix of u, l, or
-- ul.
readLitInt :: String -> Maybe CppInt
-- | Try to read an Expr from a sequence of Tokens.
parseExpr :: [Token] -> Maybe Expr
-- | Pretty-print an Expr to something semantically equivalent to
-- the original C syntax (some parentheses may be added).
renderExpr :: Expr -> String
-- | All Exprs can be evaluated to an Int.
evalExpr :: Expr -> Int
instance GHC.Show.Show Hpp.Expr.Expr
instance GHC.Classes.Ord Hpp.Expr.Expr
instance GHC.Classes.Eq Hpp.Expr.Expr
instance GHC.Show.Show Hpp.Expr.FunLike
instance GHC.Classes.Ord Hpp.Expr.FunLike
instance GHC.Classes.Eq Hpp.Expr.FunLike
instance GHC.Show.Show Hpp.Expr.Assoc
instance GHC.Classes.Ord Hpp.Expr.Assoc
instance GHC.Classes.Eq Hpp.Expr.Assoc
instance GHC.Show.Show Hpp.Expr.Parsed
instance GHC.Classes.Ord Hpp.Expr.Parsed
instance GHC.Classes.Eq Hpp.Expr.Parsed
instance GHC.Show.Show Hpp.Expr.Lit
instance GHC.Classes.Ord Hpp.Expr.Lit
instance GHC.Classes.Eq Hpp.Expr.Lit
instance GHC.Show.Show Hpp.Expr.UnaryOp
instance GHC.Classes.Ord Hpp.Expr.UnaryOp
instance GHC.Classes.Eq Hpp.Expr.UnaryOp
instance GHC.Show.Show Hpp.Expr.BinOp
instance GHC.Classes.Ord Hpp.Expr.BinOp
instance GHC.Classes.Eq Hpp.Expr.BinOp
instance GHC.Classes.Eq Hpp.Expr.CppInt
instance GHC.Classes.Ord Hpp.Expr.CppInt
instance GHC.Num.Num Hpp.Expr.CppInt
-- | A name binding context, or environment.
module Hpp.Env
-- | An empty binding environment.
emptyEnv :: [a]
-- | Add a (key,value) pair to an environment.
insertPair :: a -> [a] -> [a]
-- | Delete an entry from an association list.
deleteKey :: Eq a => a -> [(a, b)] -> [(a, b)]
-- | Looks up a value in an association list. If the key is found, the
-- value is returned along with an updated association list with that key
-- at the front.
lookupKey :: Eq a => a -> [(a, b)] -> Maybe (b, [(a, b)])
-- | Preprocessor Configuration
module Hpp.Config
-- | A String representing a time.
newtype TimeString
TimeString :: String -> TimeString
[getTimeString] :: TimeString -> String
-- | A String representing a date.
newtype DateString
DateString :: String -> DateString
[getDateString] :: DateString -> String
-- | Pre-processor configuration parameterized over a functor. This is used
-- to normalize partial configurations, ConfigF Maybe, and
-- configurations suitable for the pre-processor logic, ConfigF
-- Identity. Specifically, the source file name of the file being
-- processed must be set.
data ConfigF f
Config :: f FilePath -> f [FilePath] -> f Bool -> f Bool -> f Bool -> f DateString -> f TimeString -> ConfigF f
[curFileNameF] :: ConfigF f -> f FilePath
[includePathsF] :: ConfigF f -> f [FilePath]
[spliceLongLinesF] :: ConfigF f -> f Bool
[eraseCCommentsF] :: ConfigF f -> f Bool
[inhibitLinemarkersF] :: ConfigF f -> f Bool
[prepDateF] :: ConfigF f -> f DateString
[prepTimeF] :: ConfigF f -> f TimeString
-- | A fully-populated configuration for the pre-processor.
type Config = ConfigF Identity
-- | Ensure that required configuration fields are supplied.
realizeConfig :: ConfigF Maybe -> Maybe Config
-- | Extract the current file name from a configuration.
curFileName :: Config -> FilePath
-- | Extract the include paths name from a configuration.
includePaths :: Config -> [FilePath]
-- | Determine if continued long lines should be spliced.
spliceLongLines :: Config -> Bool
-- | Determine if C-style comments should be erased.
eraseCComments :: Config -> Bool
-- | Determine if generation of linemarkers should be inhibited.
inhibitLinemarkers :: Config -> Bool
-- | The date the pre-processor was run on.
prepDate :: Config -> DateString
-- | The time of the active pre-processor invocation.
prepTime :: Config -> TimeString
-- | A default configuration with no current file name set.
defaultConfigF :: ConfigF Maybe
-- | Format a date according to the C spec.
formatPrepDate :: UTCTime -> DateString
-- | Format a time according to the C spec.
formatPrepTime :: UTCTime -> TimeString
-- | A default preprocessor configuration with date and time stamps taken
-- from the current system time.
defaultConfigFNow :: IO (ConfigF Maybe)
instance GHC.Show.Show Hpp.Config.DateString
instance GHC.Classes.Ord Hpp.Config.DateString
instance GHC.Classes.Eq Hpp.Config.DateString
instance GHC.Show.Show Hpp.Config.TimeString
instance GHC.Classes.Ord Hpp.Config.TimeString
instance GHC.Classes.Eq Hpp.Config.TimeString
-- | The core types involved used by the pre-processor.
module Hpp.Types
-- | Line numbers are represented as Ints
type LineNum = Int
-- | A macro binding environment.
type Env = [(String, Macro)]
-- | Error conditions we may encounter.
data Error
UnterminatedBranch :: Error
BadMacroDefinition :: LineNum -> Error
BadIfPredicate :: Error
BadLineArgument :: LineNum -> String -> Error
IncludeDoesNotExist :: LineNum -> FilePath -> Error
FailedInclude :: LineNum -> FilePath -> Error
UserError :: LineNum -> String -> Error
UnknownCommand :: LineNum -> String -> Error
TooFewArgumentsToMacro :: LineNum -> String -> Error
BadMacroArguments :: LineNum -> String -> Error
NoInputFile :: Error
BadCommandLine :: String -> Error
RanOutOfInput :: Error
-- | Hpp can raise various parsing errors.
class HasError m
throwError :: HasError m => Error -> m a
-- | A cleanup action that is run at most once. To be used as an abstract
-- type with only runCleanup and mkCleanup as interface.
newtype Cleanup
Cleanup :: (IORef (IO ())) -> Cleanup
-- | Runs an action and replaces it with a nop
runCleanup :: Cleanup -> IO ()
-- | mkCleanup cleanup returns two things: a Cleanup value,
-- and an action to neutralize that Cleanup. In this way, the
-- Cleanup value can be registered with a resource manager so
-- that, in the event of an error, the cleanup action is run, while the
-- neutralizer may be used to ensure that the registered Cleanup
-- action has no effect if it is run. Typically one would neutralize a
-- registered cleanup action before performing a manual cleanup that
-- subsumes the registered cleanup.
mkCleanup :: IO () -> IO (Cleanup, IO ())
-- | Base functor for a free monad transformer
data FreeF f a r
PureF :: a -> FreeF f a r
FreeF :: (f r) -> FreeF f a r
-- | Dynamic state of the preprocessor engine.
data HppState
HppState :: Config -> LineNum -> [Cleanup] -> Env -> HppState
[hppConfig] :: HppState -> Config
[hppLineNum] :: HppState -> LineNum
[hppCleanups] :: HppState -> [Cleanup]
[hppEnv] :: HppState -> Env
-- | A free monad construction to strictly delimit what capabilities we
-- need to perform pre-processing.
data HppF t r
ReadFile :: Int -> FilePath -> (t -> r) -> HppF t r
ReadNext :: Int -> FilePath -> (t -> r) -> HppF t r
GetState :: (HppState -> r) -> HppF t r
SetState :: HppState -> r -> HppF t r
ThrowError :: Error -> HppF t r
-- | A free monad transformer specialized to HppF as the base functor.
newtype HppT t m a
HppT :: m (FreeF (HppF t) a (HppT t m a)) -> HppT t m a
[runHppT] :: HppT t m a -> m (FreeF (HppF t) a (HppT t m a))
-- | An interpreter capability to modify dynamic state.
class HasHppState m
getState :: HasHppState m => m HppState
setState :: HasHppState m => HppState -> m ()
-- | An interpreter capability of threading a binding environment.
class HasEnv m
getEnv :: HasEnv m => m Env
setEnv :: HasEnv m => Env -> m ()
-- | Macro expansion involves treating tokens differently if they appear in
-- the original source for or as the result of a previous macro
-- expansion. This distinction is used to prevent divergence by masking
-- out definitions that could be used recursively.
--
-- Things are made somewhat more complicated than one might expect due to
-- the fact that the scope of this masking is not structurally
-- recursive. A object-like macro can expand into a fragment of a macro
-- function application, one of whose arguments is a token matching the
-- original object-like macro. That argument should not be
-- expanded.
data Scan
Unmask :: String -> Scan
Mask :: String -> Scan
Scan :: Token -> Scan
Rescan :: Token -> Scan
-- | There are object-like macros and function-like macros.
data Macro
-- | An object-like macro is replaced with its definition
Object :: [Token] -> Macro
-- | A function-like macro of some arity taks macro-expanded and raw
-- versions of its arguments, then substitutes them into a body producing
-- a new set of tokens.
Function :: Int -> ([([Scan], String)] -> [Scan]) -> Macro
instance GHC.Show.Show Hpp.Types.Scan
instance GHC.Classes.Eq Hpp.Types.Scan
instance GHC.Show.Show Hpp.Types.Error
instance GHC.Classes.Ord Hpp.Types.Error
instance GHC.Classes.Eq Hpp.Types.Error
instance GHC.Base.Monad m => Hpp.Types.HasError (Control.Monad.Trans.Except.ExceptT Hpp.Types.Error m)
instance (GHC.Base.Monad m, Hpp.Types.HasHppState m) => Hpp.Types.HasHppState (Control.Monad.Trans.Except.ExceptT e m)
instance GHC.Base.Functor f => GHC.Base.Functor (Hpp.Types.FreeF f a)
instance GHC.Base.Functor (Hpp.Types.HppF t)
instance GHC.Base.Functor m => GHC.Base.Functor (Hpp.Types.HppT t m)
instance GHC.Base.Monad m => GHC.Base.Applicative (Hpp.Types.HppT t m)
instance GHC.Base.Monad m => GHC.Base.Monad (Hpp.Types.HppT t m)
instance Control.Monad.Trans.Class.MonadTrans (Hpp.Types.HppT t)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Hpp.Types.HppT t m)
instance GHC.Base.Monad m => Hpp.Types.HasHppState (Hpp.Types.HppT t m)
instance GHC.Base.Monad m => Hpp.Types.HasEnv (Hpp.Types.HppT t m)
instance GHC.Base.Applicative m => Hpp.Types.HasError (Hpp.Types.HppT t m)
instance (Hpp.Types.HasEnv m, GHC.Base.Monad m) => Hpp.Types.HasEnv (Control.Monad.Trans.Except.ExceptT e m)
instance GHC.Show.Show Hpp.Types.Macro
-- | Streaming input and output.
module Hpp.Streamer
-- | A stream of steps in a computational context.
newtype Streamer m i o r
Streamer :: m (StreamStep r i o (Streamer m i o r)) -> Streamer m i o r
[runStream] :: Streamer m i o r -> m (StreamStep r i o (Streamer m i o r))
-- | Basic pipe.
data StreamStep r i o f
Await :: (i -> f) -> f -> StreamStep r i o f
Yield :: !o -> f -> StreamStep r i o f
Done :: (Maybe r) -> StreamStep r i o f
-- | A stream of steps that never awaits anything from upstream.
type Source m o r = Streamer m Void o r
-- | Package a step into a Streamer
encase :: Monad m => StreamStep r i o (Streamer m i o r) -> Streamer m i o r
-- | The end of a stream.
done :: Monad m => r -> Streamer m i o r
-- | Yield a value downstream, then finish.
yield :: Monad m => o -> Streamer m i o ()
-- | Yield a value then continue with another Streamer.
yields :: Monad m => o -> Streamer m i o r -> Streamer m i o r
-- | Package a function that returns a Streamer into a
-- Streamer.
awaits :: Monad m => (i -> Streamer m i o r) -> Streamer m i o r
-- | Feed values downstream.
source :: (Monad m, Foldable f) => f a -> Streamer m i a ()
-- | Lift a monadic value into a Streamer
liftS :: Functor m => m a -> Streamer m i o a
-- | Compute the next step of a Streamer.
nextOutput :: Monad m => Streamer m i o r -> m (Either (Maybe r) (o, Streamer m i o r))
-- | A source whose outputs have all been sunk may be run for its effects
-- and return value.
run :: Monad m => Source m Void r -> m (Maybe r)
-- | x before y runs x to completion, discards its
-- Done value, then becomes y.
before :: Monad m => Streamer m i o q -> Streamer m i o r -> Streamer m i o r
-- | upstream ~> downstream composes two streams such that
-- values flow from upstream to downstream.
(~>) :: Monad m => Streamer m a b r -> Streamer m b c r' -> Streamer m a c r'
-- | processPrefix src snk is like ~> except that when
-- snk finishes, the composite Streamer becomes the
-- remaining src.
processPrefix :: Monad m => Source m o r -> Streamer m o o r' -> Source m o r
-- | Apply a function to each value in a stream.
mapping :: Monad m => (a -> b) -> Streamer m a b r
-- | Discard all values that do not satisfy a predicate.
filtering :: Monad m => (a -> Bool) -> Streamer m a a r
-- | Map a function over the values yielded by a stream.
mapStream :: Monad m => (a -> b) -> Streamer m i a r -> Streamer m i b r
-- | A combined filter and map.
mappingMaybe :: Monad m => (a -> Maybe b) -> Streamer m a b r
-- | Apply a function to the ending value of a stream.
onDone :: Monad m => (Maybe r -> Maybe r') -> Streamer m i o r -> Streamer m i o r'
-- | See flattenTil for an explanation.
mapTil :: Monad m => (a -> b) -> Streamer m Void a r -> Streamer m Void b (Streamer m Void a r)
-- | Flatten out chunks of inputs into individual values. The returned
-- Source smuggles the remaining original Source in an
-- Await constructor, while the flattened source continues on with
-- the "empty" part of the Await step. The upshot is that the
-- value may be used a regular Source, but it can also be swapped
-- back into the original Source.
flattenTil :: Monad m => Source m [i] r -> Source m i (Source m [i] r)
-- | A function that produces an output stream that finishes with another
-- such function. Think of the input to this function as coming from
-- upstream, while the closure of the streamed output may be used to
-- thread state.
newtype Chunky m a b
Chunky :: (a -> Source m b (Chunky m a b)) -> Chunky m a b
-- | This is something like a composition of an unfold with a fold. We fold
-- the upstream values into some state carried by a Chunky, then
-- unfold that state in the Chunky's output stream.
metamorph :: Monad m => Chunky m a b -> Streamer m a b ()
instance GHC.Base.Functor (Hpp.Streamer.StreamStep r i o)
instance GHC.Base.Monad m => GHC.Base.Functor (Hpp.Streamer.Streamer m i o)
instance GHC.Base.Monad m => GHC.Base.Applicative (Hpp.Streamer.Streamer m i o)
instance GHC.Base.Monad m => GHC.Base.Alternative (Hpp.Streamer.Streamer m r i)
instance (GHC.Base.Monad m, Hpp.Types.HasError m) => Hpp.Types.HasError (Hpp.Streamer.Streamer m i o)
instance (GHC.Base.Monad m, Hpp.Types.HasHppState m) => Hpp.Types.HasHppState (Hpp.Streamer.Streamer m i o)
instance (GHC.Base.Monad m, Hpp.Types.HasEnv m) => Hpp.Types.HasEnv (Hpp.Streamer.Streamer m i o)
-- | Parsers over streaming input.
module Hpp.Parser
-- | A Parser is a Streamer whose monadic context is a bit of
-- state carrying a source input stream.
newtype Parser m i o
Parser :: (forall r. ParserR m r i o) -> Parser m i o
[runParser] :: Parser m i o -> forall r. ParserR m r i o
-- | Run a Parser with a given input stream.
parse :: Monad m => Parser m i o -> Source m i r -> m o
-- | Waits for a value from upstream. Returns Nothing if upstream is
-- empty.
awaitP :: Monad m => Parser m i (Maybe i)
-- | awaitP that throws an error with the given message if no more
-- input is available. This may be used to locate where in a processing
-- pipeline input was unexpectedly exhausted.
awaitJust :: (Monad m, HasError m) => String -> Parser m i i
-- | Push a value back into a parser's source.
replace :: Monad m => i -> Parser m i ()
-- | Discard all values until one fails to satisfy a predicate. At that
-- point, the failing value is replaced, and the
-- droppingWhile stream stops.
droppingWhile :: Monad m => (i -> Bool) -> Parser m i ()
-- | Lift a monadic action into a Parser.
liftP :: Monad m => m o -> Parser m i o
-- | onParserSource proc feeds the Parser source through
-- proc using processPrefix. This means that when
-- proc finishes, the remaining source continues unmodified.
onParserSource :: Monad m => Streamer m i i () -> Parser m i ()
-- | Push a stream of values back into a parser's source.
precede :: Monad m => Source m i r -> Parser m i ()
-- | Echo all values until one fails to satisfy a predicate. At that point,
-- the failing value is replaced, and the takingWhile
-- stream stops.
takingWhile :: Monad m => (i -> Bool) -> Parser m i [i]
-- | This is rather like a Lens zoom, but quite fragile. The idea is that
-- we run a Parser on a transformation of the original source. The
-- transformation of the source is responsible for yielding transformed
-- values, and ending on demand with the rest of the original
-- source. We additionally scoop up any leftover transformed values and
-- prepend them onto the remaining source after inverting the original
-- transformation.
zoomParse :: Monad m => (forall r. Source m a r -> Source m b (Source m a r)) -> Parser m b o -> Parser m a o
-- | Turn a Parser on individual values into a Parser on
-- chunks.
zoomParseChunks :: Monad m => Parser m i r -> Parser m [i] r
instance GHC.Base.Functor m => GHC.Base.Functor (Hpp.Parser.Parser m i)
instance GHC.Base.Monad m => GHC.Base.Applicative (Hpp.Parser.Parser m i)
instance GHC.Base.Monad m => GHC.Base.Monad (Hpp.Parser.Parser m i)
instance GHC.Base.MonadPlus m => GHC.Base.Alternative (Hpp.Parser.Parser m i)
instance (GHC.Base.Monad m, Hpp.Types.HasError m) => Hpp.Types.HasError (Hpp.Parser.Parser m i)
instance (GHC.Base.Monad m, Hpp.Types.HasHppState m) => Hpp.Types.HasHppState (Hpp.Parser.Parser m i)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Hpp.Parser.Parser m i)
-- | Line expansion is the core input token processing logic. Object-like
-- macros are substituted, and function-like macro applications are
-- expanded.
module Hpp.Expansion
-- | Expand all macros to the end of the current line or until all
-- in-progress macro invocations are complete, whichever comes last.
expandLine :: (HasError m, Monad m, HasEnv m) => Config -> Int -> Parser m Token [Token]
-- | IO on streams.
module Hpp.StreamIO
-- | sourceFile registerCleanup filePath produces a Source
-- of lines from file filePath after registering an action that
-- closes the file using the provided registerCleanup function.
sourceFile :: (MonadIO m, MonadIO m') => (Cleanup -> m' ()) -> FilePath -> m' (Source m String ())
-- | Incrementally writes Strings to a temporary file. When all
-- input is exhausted, the temporary file is renamed to the supplied
-- FilePath.
sinkToFile :: MonadIO m => (Cleanup -> m ()) -> FilePath -> Streamer m String o ()
-- | Sink a stream with a function evaluated only for its side-effects.
sinkTell :: Monad m => (a -> m ()) -> Streamer m a o ()
-- | Sink a stream to stdout
sinkToStdOut :: MonadIO m => Streamer m String o ()
-- | sink_ = forever await Simply discards all inputs. This may be
-- used to exhaust a stream solely for its effects.
sink_ :: Monad m => Streamer m i o ()
-- | Front-end interface to the pre-processor.
module Hpp
-- | Parse the definition of an object-like or function macro.
parseDefinition :: [Token] -> Maybe (String, Macro)
-- | Run a stream of lines through the preprocessor.
preprocess :: (Monad m, HppCaps m) => Source m String () -> Source m String ()
-- | Yield a value downstream, then finish.
yield :: Monad m => o -> Streamer m i o ()
-- | x before y runs x to completion, discards its
-- Done value, then becomes y.
before :: Monad m => Streamer m i o q -> Streamer m i o r -> Streamer m i o r
-- | Feed values downstream.
source :: (Monad m, Foldable f) => f a -> Streamer m i a ()
-- | Read a file as an Hpp action
hppReadFile :: HasHppFileIO m => Int -> FilePath -> m (InputStream m)
-- | Monad morphism between Hpp and IO.
hppIO :: (MonadIO m) => Config -> Env -> Streamer (HppStream m) Void b r -> Streamer (HppStream m) b Void () -> m (Maybe ())
-- | Register a Cleanup in a threaded HppState.
hppRegisterCleanup :: (HasHppState m, Monad m) => Cleanup -> m ()
-- | Preprocess the given file producing line by line output.
streamHpp :: (Monad m, HasHppFileIO m) => FilePath -> Source m String ()
-- | Incrementally writes Strings to a temporary file. When all
-- input is exhausted, the temporary file is renamed to the supplied
-- FilePath.
sinkToFile :: MonadIO m => (Cleanup -> m ()) -> FilePath -> Streamer m String o ()
-- | Sink a stream to stdout
sinkToStdOut :: MonadIO m => Streamer m String o ()
-- | upstream ~> downstream composes two streams such that
-- values flow from upstream to downstream.
(~>) :: Monad m => Streamer m a b r -> Streamer m b c r' -> Streamer m a c r'
-- | The dynamic capabilities offered by HPP
type HppCaps t = (HasError t, HasHppState t, HasHppFileIO t, HasEnv t)
instance GHC.Base.Monad m => Hpp.Types.HasEnv (Hpp.HppStream m)
instance GHC.Base.Applicative m => Hpp.Types.HasError (Hpp.HppStream m)
instance GHC.Base.Monad m => Hpp.Types.HasHppState (Hpp.HppStream m)
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Hpp.HppStream m)
instance GHC.Base.Monad m => GHC.Base.Monad (Hpp.HppStream m)
instance GHC.Base.Monad m => GHC.Base.Applicative (Hpp.HppStream m)
instance GHC.Base.Functor m => GHC.Base.Functor (Hpp.HppStream m)
instance GHC.Base.Monad m => Hpp.HasHppFileIO (Hpp.HppStream m)
-- | A front-end to run Hpp with textual arguments as from a command line
-- invocation.
module Hpp.CmdLine
-- | Run Hpp with the given commandline arguments.
runWithArgs :: [String] -> IO ()