{-# LANGUAGE CPP #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Language.Haskell.Exts.Simple.Parser (
module Language.Haskell.Exts.Simple.Parser,
module Language.Haskell.Exts.Parser
) where
import qualified Language.Haskell.Exts.Parser as H
import qualified Language.Haskell.Exts.SrcLoc as H
import Language.Haskell.Exts.Parser (
Parseable,
ParseResult (..),
ParseMode (..),
defaultParseMode,
fromParseResult,
NonGreedy (..),
unListOf,
)
import Language.Haskell.Exts.Simple.Syntax
import Language.Haskell.Exts.Comments (Comment)
import Control.Arrow (first)
type ListOf = H.ListOf
pattern $mListOf :: forall {r} {a}. ListOf a -> ([a] -> r) -> ((# #) -> r) -> r
$bListOf :: forall {a}. [a] -> ListOf a
ListOf a <- H.ListOf _ a
where ListOf [a]
a = [a] -> ListOf a
forall {a}. [a] -> ListOf a
listOf [a]
a
listOf :: [a] -> ListOf a
listOf :: forall {a}. [a] -> ListOf a
listOf [a]
a = SrcSpanInfo -> [a] -> ListOf a
forall a. SrcSpanInfo -> [a] -> ListOf a
H.ListOf SrcSpanInfo
H.noSrcSpan [a]
a
#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)
{-# COMPLETE ListOf #-}
#endif
type PragmasAndModuleName = H.PragmasAndModuleName ()
pattern $mPragmasAndModuleName :: forall {r}.
PragmasAndModuleName
-> ([ModulePragma] -> Maybe ModuleName -> r) -> ((# #) -> r) -> r
$bPragmasAndModuleName :: [ModulePragma] -> Maybe ModuleName -> PragmasAndModuleName
PragmasAndModuleName a b = H.PragmasAndModuleName () (a :: [ModulePragma]) (b :: Maybe ModuleName) :: PragmasAndModuleName
#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)
{-# COMPLETE PragmasAndModuleName #-}
#endif
type PragmasAndModuleHead = H.PragmasAndModuleHead ()
pattern $mPragmasAndModuleHead :: forall {r}.
PragmasAndModuleHead ()
-> ([ModulePragma] -> Maybe ModuleHead -> r) -> ((# #) -> r) -> r
$bPragmasAndModuleHead :: [ModulePragma] -> Maybe ModuleHead -> PragmasAndModuleHead ()
PragmasAndModuleHead a b = H.PragmasAndModuleHead () (a :: [ModulePragma]) (b :: Maybe ModuleHead)
#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)
{-# COMPLETE PragmasAndModuleHead #-}
#endif
type ModuleHeadAndImports = H.ModuleHeadAndImports ()
pattern $mModuleHeadAndImports :: forall {r}.
ModuleHeadAndImports ()
-> ([ModulePragma] -> Maybe ModuleHead -> [ImportDecl] -> r)
-> ((# #) -> r)
-> r
$bModuleHeadAndImports :: [ModulePragma]
-> Maybe ModuleHead -> [ImportDecl] -> ModuleHeadAndImports ()
ModuleHeadAndImports a b c = H.ModuleHeadAndImports () (a :: [ModulePragma]) (b :: Maybe ModuleHead) (c :: [ImportDecl])
#if MIN_VERSION_GLASGOW_HASKELL(8,2,1,0)
{-# COMPLETE ModuleHeadAndImports #-}
#endif
parse :: (Parseable (ast H.SrcSpanInfo), Functor ast) => String -> ParseResult (ast ())
parse :: forall (ast :: * -> *).
(Parseable (ast SrcSpanInfo), Functor ast) =>
String -> ParseResult (ast ())
parse = (ast SrcSpanInfo -> ast ())
-> ParseResult (ast SrcSpanInfo) -> ParseResult (ast ())
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> ast SrcSpanInfo -> ast ()
forall a b. (a -> b) -> ast a -> ast b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const () :: H.SrcSpanInfo -> ())) (ParseResult (ast SrcSpanInfo) -> ParseResult (ast ()))
-> (String -> ParseResult (ast SrcSpanInfo))
-> String
-> ParseResult (ast ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (ast SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
H.parse
parseWithMode :: (Parseable (ast H.SrcSpanInfo), Functor ast) => ParseMode -> String -> ParseResult (ast ())
parseWithMode :: forall (ast :: * -> *).
(Parseable (ast SrcSpanInfo), Functor ast) =>
ParseMode -> String -> ParseResult (ast ())
parseWithMode ParseMode
m = (ast SrcSpanInfo -> ast ())
-> ParseResult (ast SrcSpanInfo) -> ParseResult (ast ())
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> ast SrcSpanInfo -> ast ()
forall a b. (a -> b) -> ast a -> ast b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const () :: H.SrcSpanInfo -> ())) (ParseResult (ast SrcSpanInfo) -> ParseResult (ast ()))
-> (String -> ParseResult (ast SrcSpanInfo))
-> String
-> ParseResult (ast ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (ast SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
H.parseWithMode ParseMode
m
parseWithComments :: (Parseable (ast H.SrcSpanInfo), Functor ast) => ParseMode -> String -> ParseResult (ast (), [Comment])
ParseMode
m = ((ast SrcSpanInfo, [Comment]) -> (ast (), [Comment]))
-> ParseResult (ast SrcSpanInfo, [Comment])
-> ParseResult (ast (), [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((ast SrcSpanInfo -> ast ())
-> (ast SrcSpanInfo, [Comment]) -> (ast (), [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> ast SrcSpanInfo -> ast ()
forall a b. (a -> b) -> ast a -> ast b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const () :: H.SrcSpanInfo -> ()))) (ParseResult (ast SrcSpanInfo, [Comment])
-> ParseResult (ast (), [Comment]))
-> (String -> ParseResult (ast SrcSpanInfo, [Comment]))
-> String
-> ParseResult (ast (), [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (ast SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
H.parseWithComments ParseMode
m
parseModule :: String -> ParseResult Module
parseModule :: String -> ParseResult Module
parseModule = (Module SrcSpanInfo -> Module)
-> ParseResult (Module SrcSpanInfo) -> ParseResult Module
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Module SrcSpanInfo -> Module
forall a b. (a -> b) -> Module a -> Module b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Module SrcSpanInfo) -> ParseResult Module)
-> (String -> ParseResult (Module SrcSpanInfo))
-> String
-> ParseResult Module
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (Module SrcSpanInfo)
H.parseModule
parseModuleWithMode :: ParseMode -> String -> ParseResult Module
parseModuleWithMode :: ParseMode -> String -> ParseResult Module
parseModuleWithMode ParseMode
m = (Module SrcSpanInfo -> Module)
-> ParseResult (Module SrcSpanInfo) -> ParseResult Module
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Module SrcSpanInfo -> Module
forall a b. (a -> b) -> Module a -> Module b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Module SrcSpanInfo) -> ParseResult Module)
-> (String -> ParseResult (Module SrcSpanInfo))
-> String
-> ParseResult Module
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Module SrcSpanInfo)
H.parseModuleWithMode ParseMode
m
parseModuleWithComments :: ParseMode -> String -> ParseResult (Module, [Comment])
ParseMode
m = ((Module SrcSpanInfo, [Comment]) -> (Module, [Comment]))
-> ParseResult (Module SrcSpanInfo, [Comment])
-> ParseResult (Module, [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Module SrcSpanInfo -> Module)
-> (Module SrcSpanInfo, [Comment]) -> (Module, [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> Module SrcSpanInfo -> Module
forall a b. (a -> b) -> Module a -> Module b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult (Module SrcSpanInfo, [Comment])
-> ParseResult (Module, [Comment]))
-> (String -> ParseResult (Module SrcSpanInfo, [Comment]))
-> String
-> ParseResult (Module, [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])
H.parseModuleWithComments ParseMode
m
parseExp :: String -> ParseResult Exp
parseExp :: String -> ParseResult Exp
parseExp = (Exp SrcSpanInfo -> Exp)
-> ParseResult (Exp SrcSpanInfo) -> ParseResult Exp
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Exp SrcSpanInfo -> Exp
forall a b. (a -> b) -> Exp a -> Exp b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Exp SrcSpanInfo) -> ParseResult Exp)
-> (String -> ParseResult (Exp SrcSpanInfo))
-> String
-> ParseResult Exp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (Exp SrcSpanInfo)
H.parseExp
parseExpWithMode :: ParseMode -> String -> ParseResult Exp
parseExpWithMode :: ParseMode -> String -> ParseResult Exp
parseExpWithMode ParseMode
m = (Exp SrcSpanInfo -> Exp)
-> ParseResult (Exp SrcSpanInfo) -> ParseResult Exp
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Exp SrcSpanInfo -> Exp
forall a b. (a -> b) -> Exp a -> Exp b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Exp SrcSpanInfo) -> ParseResult Exp)
-> (String -> ParseResult (Exp SrcSpanInfo))
-> String
-> ParseResult Exp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Exp SrcSpanInfo)
H.parseExpWithMode ParseMode
m
parseExpWithComments :: ParseMode -> String -> ParseResult (Exp, [Comment])
ParseMode
m = ((Exp SrcSpanInfo, [Comment]) -> (Exp, [Comment]))
-> ParseResult (Exp SrcSpanInfo, [Comment])
-> ParseResult (Exp, [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Exp SrcSpanInfo -> Exp)
-> (Exp SrcSpanInfo, [Comment]) -> (Exp, [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> Exp SrcSpanInfo -> Exp
forall a b. (a -> b) -> Exp a -> Exp b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult (Exp SrcSpanInfo, [Comment])
-> ParseResult (Exp, [Comment]))
-> (String -> ParseResult (Exp SrcSpanInfo, [Comment]))
-> String
-> ParseResult (Exp, [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Exp SrcSpanInfo, [Comment])
H.parseExpWithComments ParseMode
m
parsePat :: String -> ParseResult Pat
parsePat :: String -> ParseResult Pat
parsePat = (Pat SrcSpanInfo -> Pat)
-> ParseResult (Pat SrcSpanInfo) -> ParseResult Pat
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Pat SrcSpanInfo -> Pat
forall a b. (a -> b) -> Pat a -> Pat b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Pat SrcSpanInfo) -> ParseResult Pat)
-> (String -> ParseResult (Pat SrcSpanInfo))
-> String
-> ParseResult Pat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (Pat SrcSpanInfo)
H.parsePat
parsePatWithMode :: ParseMode -> String -> ParseResult Pat
parsePatWithMode :: ParseMode -> String -> ParseResult Pat
parsePatWithMode ParseMode
m = (Pat SrcSpanInfo -> Pat)
-> ParseResult (Pat SrcSpanInfo) -> ParseResult Pat
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Pat SrcSpanInfo -> Pat
forall a b. (a -> b) -> Pat a -> Pat b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Pat SrcSpanInfo) -> ParseResult Pat)
-> (String -> ParseResult (Pat SrcSpanInfo))
-> String
-> ParseResult Pat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Pat SrcSpanInfo)
H.parsePatWithMode ParseMode
m
parsePatWithComments :: ParseMode -> String -> ParseResult (Pat, [Comment])
ParseMode
m = ((Pat SrcSpanInfo, [Comment]) -> (Pat, [Comment]))
-> ParseResult (Pat SrcSpanInfo, [Comment])
-> ParseResult (Pat, [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Pat SrcSpanInfo -> Pat)
-> (Pat SrcSpanInfo, [Comment]) -> (Pat, [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> Pat SrcSpanInfo -> Pat
forall a b. (a -> b) -> Pat a -> Pat b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult (Pat SrcSpanInfo, [Comment])
-> ParseResult (Pat, [Comment]))
-> (String -> ParseResult (Pat SrcSpanInfo, [Comment]))
-> String
-> ParseResult (Pat, [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Pat SrcSpanInfo, [Comment])
H.parsePatWithComments ParseMode
m
parseDecl :: String -> ParseResult Decl
parseDecl :: String -> ParseResult Decl
parseDecl = (Decl SrcSpanInfo -> Decl)
-> ParseResult (Decl SrcSpanInfo) -> ParseResult Decl
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Decl SrcSpanInfo -> Decl
forall a b. (a -> b) -> Decl a -> Decl b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Decl SrcSpanInfo) -> ParseResult Decl)
-> (String -> ParseResult (Decl SrcSpanInfo))
-> String
-> ParseResult Decl
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (Decl SrcSpanInfo)
H.parseDecl
parseDeclWithMode :: ParseMode -> String -> ParseResult Decl
parseDeclWithMode :: ParseMode -> String -> ParseResult Decl
parseDeclWithMode ParseMode
m = (Decl SrcSpanInfo -> Decl)
-> ParseResult (Decl SrcSpanInfo) -> ParseResult Decl
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Decl SrcSpanInfo -> Decl
forall a b. (a -> b) -> Decl a -> Decl b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Decl SrcSpanInfo) -> ParseResult Decl)
-> (String -> ParseResult (Decl SrcSpanInfo))
-> String
-> ParseResult Decl
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Decl SrcSpanInfo)
H.parseDeclWithMode ParseMode
m
parseDeclWithComments :: ParseMode -> String -> ParseResult (Decl, [Comment])
ParseMode
m = ((Decl SrcSpanInfo, [Comment]) -> (Decl, [Comment]))
-> ParseResult (Decl SrcSpanInfo, [Comment])
-> ParseResult (Decl, [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Decl SrcSpanInfo -> Decl)
-> (Decl SrcSpanInfo, [Comment]) -> (Decl, [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> Decl SrcSpanInfo -> Decl
forall a b. (a -> b) -> Decl a -> Decl b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult (Decl SrcSpanInfo, [Comment])
-> ParseResult (Decl, [Comment]))
-> (String -> ParseResult (Decl SrcSpanInfo, [Comment]))
-> String
-> ParseResult (Decl, [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Decl SrcSpanInfo, [Comment])
H.parseDeclWithComments ParseMode
m
parseType :: String -> ParseResult Type
parseType :: String -> ParseResult Type
parseType = (Type SrcSpanInfo -> Type)
-> ParseResult (Type SrcSpanInfo) -> ParseResult Type
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Type SrcSpanInfo -> Type
forall a b. (a -> b) -> Type a -> Type b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Type SrcSpanInfo) -> ParseResult Type)
-> (String -> ParseResult (Type SrcSpanInfo))
-> String
-> ParseResult Type
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (Type SrcSpanInfo)
H.parseType
parseTypeWithMode :: ParseMode -> String -> ParseResult Type
parseTypeWithMode :: ParseMode -> String -> ParseResult Type
parseTypeWithMode ParseMode
m = (Type SrcSpanInfo -> Type)
-> ParseResult (Type SrcSpanInfo) -> ParseResult Type
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Type SrcSpanInfo -> Type
forall a b. (a -> b) -> Type a -> Type b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Type SrcSpanInfo) -> ParseResult Type)
-> (String -> ParseResult (Type SrcSpanInfo))
-> String
-> ParseResult Type
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Type SrcSpanInfo)
H.parseTypeWithMode ParseMode
m
parseTypeWithComments :: ParseMode -> String -> ParseResult (Type, [Comment])
ParseMode
m = ((Type SrcSpanInfo, [Comment]) -> (Type, [Comment]))
-> ParseResult (Type SrcSpanInfo, [Comment])
-> ParseResult (Type, [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Type SrcSpanInfo -> Type)
-> (Type SrcSpanInfo, [Comment]) -> (Type, [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> Type SrcSpanInfo -> Type
forall a b. (a -> b) -> Type a -> Type b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult (Type SrcSpanInfo, [Comment])
-> ParseResult (Type, [Comment]))
-> (String -> ParseResult (Type SrcSpanInfo, [Comment]))
-> String
-> ParseResult (Type, [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Type SrcSpanInfo, [Comment])
H.parseTypeWithComments ParseMode
m
parseStmt :: String -> ParseResult Stmt
parseStmt :: String -> ParseResult Stmt
parseStmt = (Stmt SrcSpanInfo -> Stmt)
-> ParseResult (Stmt SrcSpanInfo) -> ParseResult Stmt
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Stmt SrcSpanInfo -> Stmt
forall a b. (a -> b) -> Stmt a -> Stmt b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Stmt SrcSpanInfo) -> ParseResult Stmt)
-> (String -> ParseResult (Stmt SrcSpanInfo))
-> String
-> ParseResult Stmt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (Stmt SrcSpanInfo)
H.parseStmt
parseStmtWithMode :: ParseMode -> String -> ParseResult Stmt
parseStmtWithMode :: ParseMode -> String -> ParseResult Stmt
parseStmtWithMode ParseMode
m = (Stmt SrcSpanInfo -> Stmt)
-> ParseResult (Stmt SrcSpanInfo) -> ParseResult Stmt
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> Stmt SrcSpanInfo -> Stmt
forall a b. (a -> b) -> Stmt a -> Stmt b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (Stmt SrcSpanInfo) -> ParseResult Stmt)
-> (String -> ParseResult (Stmt SrcSpanInfo))
-> String
-> ParseResult Stmt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Stmt SrcSpanInfo)
H.parseStmtWithMode ParseMode
m
parseStmtWithComments :: ParseMode -> String -> ParseResult (Stmt, [Comment])
ParseMode
m = ((Stmt SrcSpanInfo, [Comment]) -> (Stmt, [Comment]))
-> ParseResult (Stmt SrcSpanInfo, [Comment])
-> ParseResult (Stmt, [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Stmt SrcSpanInfo -> Stmt)
-> (Stmt SrcSpanInfo, [Comment]) -> (Stmt, [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> Stmt SrcSpanInfo -> Stmt
forall a b. (a -> b) -> Stmt a -> Stmt b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult (Stmt SrcSpanInfo, [Comment])
-> ParseResult (Stmt, [Comment]))
-> (String -> ParseResult (Stmt SrcSpanInfo, [Comment]))
-> String
-> ParseResult (Stmt, [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (Stmt SrcSpanInfo, [Comment])
H.parseStmtWithComments ParseMode
m
parseImportDecl :: String -> ParseResult ImportDecl
parseImportDecl :: String -> ParseResult ImportDecl
parseImportDecl = (ImportDecl SrcSpanInfo -> ImportDecl)
-> ParseResult (ImportDecl SrcSpanInfo) -> ParseResult ImportDecl
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> ImportDecl SrcSpanInfo -> ImportDecl
forall a b. (a -> b) -> ImportDecl a -> ImportDecl b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (ImportDecl SrcSpanInfo) -> ParseResult ImportDecl)
-> (String -> ParseResult (ImportDecl SrcSpanInfo))
-> String
-> ParseResult ImportDecl
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult (ImportDecl SrcSpanInfo)
H.parseImportDecl
parseImportDeclWithMode :: ParseMode -> String -> ParseResult ImportDecl
parseImportDeclWithMode :: ParseMode -> String -> ParseResult ImportDecl
parseImportDeclWithMode ParseMode
m = (ImportDecl SrcSpanInfo -> ImportDecl)
-> ParseResult (ImportDecl SrcSpanInfo) -> ParseResult ImportDecl
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> ImportDecl SrcSpanInfo -> ImportDecl
forall a b. (a -> b) -> ImportDecl a -> ImportDecl b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ())) (ParseResult (ImportDecl SrcSpanInfo) -> ParseResult ImportDecl)
-> (String -> ParseResult (ImportDecl SrcSpanInfo))
-> String
-> ParseResult ImportDecl
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo)
H.parseImportDeclWithMode ParseMode
m
parseImportDeclWithComments :: ParseMode -> String -> ParseResult (ImportDecl, [Comment])
ParseMode
m = ((ImportDecl SrcSpanInfo, [Comment]) -> (ImportDecl, [Comment]))
-> ParseResult (ImportDecl SrcSpanInfo, [Comment])
-> ParseResult (ImportDecl, [Comment])
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((ImportDecl SrcSpanInfo -> ImportDecl)
-> (ImportDecl SrcSpanInfo, [Comment]) -> (ImportDecl, [Comment])
forall b c d. (b -> c) -> (b, d) -> (c, d)
forall (a :: * -> * -> *) b c d.
Arrow a =>
a b c -> a (b, d) (c, d)
first ((SrcSpanInfo -> ()) -> ImportDecl SrcSpanInfo -> ImportDecl
forall a b. (a -> b) -> ImportDecl a -> ImportDecl b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult (ImportDecl SrcSpanInfo, [Comment])
-> ParseResult (ImportDecl, [Comment]))
-> (String -> ParseResult (ImportDecl SrcSpanInfo, [Comment]))
-> String
-> ParseResult (ImportDecl, [Comment])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ParseMode
-> String -> ParseResult (ImportDecl SrcSpanInfo, [Comment])
H.parseImportDeclWithComments ParseMode
m
getTopPragmas :: String -> ParseResult [ModulePragma]
getTopPragmas :: String -> ParseResult [ModulePragma]
getTopPragmas = ([ModulePragma SrcSpanInfo] -> [ModulePragma])
-> ParseResult [ModulePragma SrcSpanInfo]
-> ParseResult [ModulePragma]
forall a b. (a -> b) -> ParseResult a -> ParseResult b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((ModulePragma SrcSpanInfo -> ModulePragma)
-> [ModulePragma SrcSpanInfo] -> [ModulePragma]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((SrcSpanInfo -> ()) -> ModulePragma SrcSpanInfo -> ModulePragma
forall a b. (a -> b) -> ModulePragma a -> ModulePragma b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (() -> SrcSpanInfo -> ()
forall a b. a -> b -> a
const ()))) (ParseResult [ModulePragma SrcSpanInfo]
-> ParseResult [ModulePragma])
-> (String -> ParseResult [ModulePragma SrcSpanInfo])
-> String
-> ParseResult [ModulePragma]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParseResult [ModulePragma SrcSpanInfo]
H.getTopPragmas