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


-- | Yi editor haskell mode
--   
--   Yi editor haskell mode
@package yi-mode-haskell
@version 0.19.1

module Yi.Lexer.Haskell
initState :: HlState

-- | Scan one token. Return (maybe) a token and a new state.
alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput))
tokenToStyle :: Token -> StyleName
tokenToText :: Token -> Maybe String
type TT = Tok Token
isErrorTok :: Token -> Bool
isSpecial :: String -> Token -> Bool
startsLayout :: Token -> Bool
isComment :: Token -> Bool
data Token
Number :: Token
CharTok :: Token
StringTok :: Token
VarIdent :: Token
ConsIdent :: Token
Reserved :: !ReservedType -> Token
ReservedOp :: !OpType -> Token
Special :: Char -> Token
ConsOperator :: String -> Token
Operator :: String -> Token
Comment :: !CommentType -> Token
THQuote :: Token
CppDirective :: Token
Unrecognized :: Token
type HlState = Int
data CommentType
Open :: CommentType
Close :: CommentType
Text :: CommentType
Line :: CommentType
data ReservedType
Hiding :: ReservedType
Qualified :: ReservedType
As :: ReservedType
Import :: ReservedType
Data :: ReservedType
NewType :: ReservedType
Type :: ReservedType
Where :: ReservedType
Let :: ReservedType
In :: ReservedType
Do :: ReservedType
Of :: ReservedType
OtherLayout :: ReservedType
Deriving :: ReservedType
Module :: ReservedType
Forall :: ReservedType
Other :: ReservedType
Class :: ReservedType
Instance :: ReservedType
data OpType
Pipe :: OpType
Equal :: OpType
BackSlash :: OpType
LeftArrow :: OpType
RightArrow :: OpType
DoubleRightArrow :: OpType
DoubleColon :: OpType
DoubleDot :: OpType
Arobase :: OpType
Tilda :: OpType
instance GHC.Classes.Eq Yi.Lexer.Haskell.CommentType
instance GHC.Classes.Eq Yi.Lexer.Haskell.OpType
instance GHC.Classes.Eq Yi.Lexer.Haskell.ReservedType
instance GHC.Classes.Eq Yi.Lexer.Haskell.Token
instance GHC.Internal.Show.Show Yi.Lexer.Haskell.CommentType
instance GHC.Internal.Show.Show Yi.Lexer.Haskell.OpType
instance GHC.Internal.Show.Show Yi.Lexer.Haskell.ReservedType
instance GHC.Internal.Show.Show Yi.Lexer.Haskell.Token

module Yi.Lexer.LiterateHaskell
initState :: HlState

-- | Scan one token. Return (maybe) a token and a new state.
alexScanToken :: (AlexState HlState, AlexInput) -> Maybe (Tok Token, (AlexState HlState, AlexInput))
data HlState
instance GHC.Classes.Eq Yi.Lexer.LiterateHaskell.HlState
instance GHC.Internal.Show.Show Yi.Lexer.LiterateHaskell.HlState


-- | A mode for GHCi, implemented as tweaks on Interaction mode
module Yi.Mode.GHCi

-- | The process name to use to spawn GHCi.
data GhciProcessName
GhciProcessName :: FilePath -> [String] -> GhciProcessName

-- | Command to run when spawning GHCi.
[_ghciProcessName] :: GhciProcessName -> FilePath

-- | Args to pass to the process.
[_ghciProcessArgs] :: GhciProcessName -> [String]
ghciProcessArgs :: Lens' GhciProcessName [String]
ghciProcessName :: Lens' GhciProcessName FilePath

-- | Mode used for GHCi. Currently it just overrides <a>KHome</a> key to go
--   just before the prompt through the use of <a>homeKey</a>.
mode :: Mode (Tree (Tok Token))

-- | The GHCi prompt always begins with "&gt;"; this goes to just before
--   it, or if one is already at the start of the prompt, goes to the
--   beginning of the line. (If at the beginning of the line, this pushes
--   you forward to it.)
homeKey :: BufferM ()

-- | Spawns an interactive process (<a>Yi.Mode.Interactive</a>) with GHCi
--   <a>mode</a> over it.
spawnProcess :: FilePath -> [String] -> YiM BufferRef
instance Data.Binary.Class.Binary Yi.Mode.GHCi.GhciProcessName
instance Data.Default.Internal.Default Yi.Mode.GHCi.GhciProcessName
instance GHC.Internal.Generics.Generic Yi.Mode.GHCi.GhciProcessName
instance GHC.Internal.Show.Show Yi.Mode.GHCi.GhciProcessName
instance Yi.Types.YiVariable Yi.Mode.GHCi.GhciProcessName


-- | Note if the layout of the first line (not comments) is wrong the
--   parser will only parse what is in the blocks given by Layout.hs
module Yi.Syntax.Haskell
type PModule = Exp
type PModuleDecl = Exp
type PImport = Exp

-- | Exp can be expression or declaration
data Exp t
PModule :: [t] -> Maybe (PModule t) -> Exp t
[comments] :: Exp t -> [t]
[progMod] :: Exp t -> Maybe (PModule t)
ProgMod :: PModuleDecl t -> PModule t -> Exp t
[modDecl] :: Exp t -> PModuleDecl t

-- | The module declaration part
[body] :: Exp t -> PModule t
Body :: Exp t -> Block t -> Block t -> Exp t
[imports] :: Exp t -> Exp t
[content] :: Exp t -> Block t

-- | The body of the module
[extraContent] :: Exp t -> Block t
PModuleDecl :: PAtom t -> PAtom t -> Exp t -> Exp t -> Exp t
[moduleKeyword] :: Exp t -> PAtom t
[name] :: Exp t -> PAtom t
[exports] :: Exp t -> Exp t
[whereKeyword] :: Exp t -> Exp t
PImport :: PAtom t -> Exp t -> PAtom t -> Exp t -> Exp t -> Exp t
[importKeyword] :: Exp t -> PAtom t
[qual] :: Exp t -> Exp t
[name'] :: Exp t -> PAtom t
[as] :: Exp t -> Exp t
[specification] :: Exp t -> Exp t

-- | Type signature
TS :: t -> [Exp t] -> Exp t

-- | Type declaration
PType :: PAtom t -> Exp t -> PAtom t -> Exp t -> Exp t
[typeKeyword] :: Exp t -> PAtom t
[typeCons] :: Exp t -> Exp t
[equal] :: Exp t -> PAtom t
[btype] :: Exp t -> Exp t

-- | Data declaration
PData :: PAtom t -> Exp t -> Exp t -> Exp t -> Exp t
[dataKeyword] :: Exp t -> PAtom t
[dtypeCons] :: Exp t -> Exp t
[dEqual] :: Exp t -> Exp t
[dataRhs] :: Exp t -> Exp t
PData' :: PAtom t -> Exp t -> Exp t
[dEqual] :: Exp t -> PAtom t

-- | Data declaration RHS
[dataCons] :: Exp t -> Exp t
PClass :: PAtom t -> Exp t -> Exp t -> Exp t
[cKeyword] :: Exp t -> PAtom t
[cHead] :: Exp t -> Exp t

-- | Class declaration
[cwhere] :: Exp t -> Exp t

-- | A parenthesized, bracketed or braced
Paren :: PAtom t -> [Exp t] -> PAtom t -> Exp t

-- | A block of things separated by layout
Block :: [Exp t] -> Exp t

-- | An atom is a token followed by many comments
PAtom :: t -> [t] -> Exp t
Expr :: [Exp t] -> Exp t

-- | Where clause
PWhere :: PAtom t -> Exp t -> Exp t -> Exp t
Bin :: Exp t -> Exp t -> Exp t
PError :: t -> t -> [t] -> Exp t
[errorTok] :: Exp t -> t
[marker] :: Exp t -> t

-- | An wrapper for errors
[commentList] :: Exp t -> [t]

-- | Righthandside of functions with =
RHS :: PAtom t -> Exp t -> Exp t

-- | An optional
Opt :: Maybe (Exp t) -> Exp t

-- | Module identifier
Modid :: t -> [t] -> Exp t
Context :: Exp t -> Exp t -> PAtom t -> Exp t

-- | Righthandside of functions with | the PAtom in PGuard' does not
--   contain any comments
PGuard :: [PGuard t] -> Exp t
PGuard' :: PAtom t -> Exp t -> PAtom t -> Exp t

-- | Type constructor data constructor same as with the TC constructor
TC :: Exp t -> Exp t

-- | Data constructor
DC :: Exp t -> Exp t

-- | let expression
PLet :: PAtom t -> Exp t -> Exp t -> Exp t
PIn :: t -> [Exp t] -> Exp t
type Tree = PModule

-- | The parser
parse :: P TT (Tree TT)
indentScanner :: Scanner (AlexState lexState) TT -> Scanner (State Token lexState) TT
instance GHC.Internal.Data.Foldable.Foldable Yi.Syntax.Haskell.Exp
instance Yi.Syntax.Tree.IsTree Yi.Syntax.Haskell.Exp
instance GHC.Internal.Show.Show t => GHC.Internal.Show.Show (Yi.Syntax.Haskell.Exp t)


-- | Parser for Haskell that only cares about parenthesis and layout.
module Yi.Syntax.Paren
indentScanner :: Scanner (AlexState lexState) TT -> Scanner (State Token lexState) TT
isBrace :: TT -> Bool
ignoredToken :: TT -> Bool
isNoise :: Token -> Bool
type Expr t = [Tree t]
data Tree t
Paren :: t -> Expr t -> t -> Tree t
Block :: [Tree t] -> Tree t
Atom :: t -> Tree t
Error :: t -> Tree t
Expr :: [Tree t] -> Tree t

-- | Search the given list, and return the 1st tree after the given point
--   on the given line. This is the tree that will be moved if something is
--   inserted at the point. Precondition: point is in the given line.
getIndentingSubtree :: Tree TT -> Point -> Int -> Maybe (Tree TT)

-- | Given a tree, return (first offset, number of lines).
getSubtreeSpan :: Tree TT -> (Point, Int)
parse :: P TT (Tree TT)
parse' :: (TT -> Token) -> (Token -> TT) -> P TT [Tree TT]
getStrokes :: Point -> Point -> Point -> Tree TT -> [Stroke]
tokenToStroke :: TT -> Stroke
modStroke :: StyleName -> Stroke -> Stroke
tokenToAnnot :: TT -> Maybe (Span String)

-- | Create a special error token. (e.g. fill in where there is no correct
--   token to parse) Note that the position of the token has to be correct
--   for correct computation of node spans.
errTok :: Parser (Tok t) (Tok Token)
instance GHC.Internal.Data.Foldable.Foldable Yi.Syntax.Paren.Tree
instance GHC.Internal.Base.Functor Yi.Syntax.Paren.Tree
instance Yi.Syntax.Tree.IsTree Yi.Syntax.Paren.Tree
instance GHC.Internal.Show.Show t => GHC.Internal.Show.Show (Yi.Syntax.Paren.Tree t)


module Yi.Mode.Haskell.Dollarify
dollarify :: Tree TT -> BufferM ()
dollarifyWithin :: Tree TT -> BufferM ()
data QueuedUpdate
QueuedUpdate :: Point -> YiString -> Int -> QueuedUpdate
[qUpdatePoint] :: QueuedUpdate -> Point
[qInsert] :: QueuedUpdate -> YiString
[qDelete] :: QueuedUpdate -> Int
runQ :: [QueuedUpdate] -> BufferM ()
openParen :: Token
closeParen :: Token
isNormalParen :: Tree TT -> Bool
isTuple :: Tree TT -> Bool
queueDelete :: TT -> QueuedUpdate
queueReplaceWith :: YiString -> TT -> QueuedUpdate
stripComments :: Expr TT -> Expr TT
dollarifyTop :: Tree TT -> [QueuedUpdate]
dollarifyExpr :: Expr TT -> [QueuedUpdate]
isSimple :: Tree TT -> Bool
isCollapsible :: Expr TT -> Bool
selectedTree :: Expr TT -> Region -> Maybe (Tree TT)
findLargestWithin :: Region -> [Tree TT] -> Tree TT
within :: Region -> Tree TT -> Bool
safeLast :: [a] -> Maybe a
dollarifyP :: Tree TT -> BufferM ()
dollarifyWithinP :: Exp TT -> BufferM ()
isNormalParenP :: Exp TT -> Bool
isTupleP :: Exp TT -> Bool
stripCommentsP :: [Exp TT] -> [Exp TT]
dollarifyTopP :: Exp TT -> [QueuedUpdate]
dollarifyExprP :: [Exp TT] -> [QueuedUpdate]
isSimpleP :: Exp TT -> Bool
isCollapsibleP :: [Exp TT] -> Bool
selectedTreeP :: [Exp TT] -> Region -> Maybe (Exp TT)
findLargestWithinP :: Region -> [Exp TT] -> Exp TT
withinP :: Region -> Exp TT -> Bool
safeLastP :: [a] -> Maybe a
instance GHC.Classes.Eq Yi.Mode.Haskell.Dollarify.QueuedUpdate
instance GHC.Classes.Ord Yi.Mode.Haskell.Dollarify.QueuedUpdate
instance GHC.Internal.Show.Show Yi.Mode.Haskell.Dollarify.QueuedUpdate


-- | Produces <a>Stroke</a>s from a tree of tokens, used by some of the
--   Haskell modes.
module Yi.Syntax.Strokes.Haskell
getStrokes :: Point -> Point -> Point -> Tree TT -> [Stroke]
tokenToAnnot :: TT -> Maybe (Span String)


-- | Collection of <a>Mode</a>s for working with Haskell.
module Yi.Mode.Haskell

-- | General ‘template’ for actual Haskell modes.
--   
--   It applies over <tt>extensions = ["hs", "x", "hsc", "hsinc"]</tt>
--   which may be a little questionable but for now Yi is mostly used by
--   Haskell hackers so it should be fine, at least for now.
haskellAbstract :: Mode (tree TT)

-- | <a>Clever</a> haskell mode, using the paren-matching syntax.
cleverMode :: Mode (Tree (Tok Token))

-- | Experimental Haskell mode, using a rather precise parser for the
--   syntax.
preciseMode :: Mode (Tree TT)
literateMode :: Mode (Tree TT)
fastMode :: Mode (Tree TT)

-- | Return GHCi's buffer; create it if necessary. Show it in another
--   window.
ghciGet :: YiM BufferRef

-- | Send a command to GHCi
ghciSend :: String -> YiM ()

-- | Load current buffer in GHCi
ghciLoadBuffer :: YiM ()
ghciInferType :: YiM ()
ghciSetProcessName :: YiM ()
ghciSetProcessArgs :: YiM ()
instance Data.Binary.Class.Binary Yi.Mode.Haskell.GhciBuffer
instance Data.Default.Internal.Default Yi.Mode.Haskell.GhciBuffer
instance Yi.Types.YiVariable Yi.Mode.Haskell.GhciBuffer

module Yi.Config.Default.HaskellMode
configureHaskellMode :: ConfigM ()
