-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | indentation sensitive parser-combinators for parsec
--   
--   This library provides functions for use in parsing indentation
--   sensitive contexts. It parses blocks of lines all indented to the same
--   level as well as lines continued at an indented level below.
@package indents
@version 0.3.3

module Text.Parsec.Indent

-- | Indentation sensitive parser type. Usually <tt> m </tt> will be <tt>
--   Identity </tt> as with any <tt> ParsecT </tt>
type IndentParser s u a = ParsecT s u (State SourcePos) a

-- | Run the result of an indentation sensitive parse
runIndent :: SourceName -> State SourcePos a -> a

-- | <tt> <a>withBlock</a> f a p </tt> parses <tt> a </tt> followed by an
--   indented block of <tt> p </tt> combining them with <tt> f </tt>
withBlock :: Stream s (State SourcePos) z => (a -> [b] -> c) -> IndentParser s u a -> IndentParser s u b -> IndentParser s u c

-- | Like <a>withBlock</a>, but throws away initial parse result
withBlock' :: Stream s (State SourcePos) z => IndentParser s u a -> IndentParser s u b -> IndentParser s u [b]

-- | Parses a block of lines at the same indentation level
block :: Stream s (State SourcePos) z => IndentParser s u a -> IndentParser s u [a]

-- | Parses only when indented past the level of the reference
indented :: Stream s (State SourcePos) z => IndentParser s u ()

-- | Parses only on the same line as the reference
same :: Stream s (State SourcePos) z => IndentParser s u ()

-- | Parses only when indented past the level of the reference or on the
--   same line
sameOrIndented :: Stream s (State SourcePos) z => IndentParser s u ()

-- | Ensures the current indentation level matches that of the reference
checkIndent :: Stream s (State SourcePos) z => IndentParser s u ()

-- | Parses using the current location for indentation reference
withPos :: Stream s (State SourcePos) z => IndentParser s u a -> IndentParser s u a

-- | parses with surrounding brackets
indentBrackets :: Stream s (State SourcePos) z => GenTokenParser s u (State SourcePos) -> IndentParser s u a -> IndentParser s u a

-- | parses with surrounding angle brackets
indentAngles :: Stream s (State SourcePos) z => GenTokenParser s u (State SourcePos) -> IndentParser s u a -> IndentParser s u a

-- | parses with surrounding braces
indentBraces :: Stream s (State SourcePos) z => GenTokenParser s u (State SourcePos) -> IndentParser s u a -> IndentParser s u a

-- | parses with surrounding parentheses
indentParens :: Stream s (State SourcePos) z => GenTokenParser s u (State SourcePos) -> IndentParser s u a -> IndentParser s u a

-- | <a>&lt;+/&gt;</a> is to indentation sensitive parsers what <a>ap</a>
--   is to monads
(<+/>) :: Stream s (State SourcePos) z => IndentParser s u (a -> b) -> IndentParser s u a -> IndentParser s u b

-- | <a>&lt;-/&gt;</a> is like <a>&lt;+/&gt;</a>, but doesn't apply the
--   function to the parsed value
(<-/>) :: Stream s (State SourcePos) z => IndentParser s u a -> IndentParser s u b -> IndentParser s u a

-- | Like <a>&lt;+/&gt;</a> but applies the second parser many times
(<*/>) :: Stream s (State SourcePos) z => IndentParser s u ([a] -> b) -> IndentParser s u a -> IndentParser s u b

-- | Like <a>&lt;+/&gt;</a> but applies the second parser optionally using
--   the <a>Optional</a> datatype
(<?/>) :: Stream s (State SourcePos) z => IndentParser s u (a -> b) -> (Optional s u a) -> IndentParser s u b

-- | Datatype used to optional parsing
data Optional s u a
Opt :: a -> (IndentParser s u a) -> Optional s u a
