{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, DeriveFunctor #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Language.Haskell.Exts.Parser
(
Parseable(parse, parseWithMode, parseWithComments)
, ParseMode(..), defaultParseMode, ParseResult(..), fromParseResult
, parseModule, parseModuleWithMode, parseModuleWithComments
, parseExp, parseExpWithMode, parseExpWithComments
, parseStmt, parseStmtWithMode, parseStmtWithComments
, parsePat, parsePatWithMode, parsePatWithComments
, parseDecl, parseDeclWithMode, parseDeclWithComments
, parseType, parseTypeWithMode, parseTypeWithComments
, parseImportDecl, parseImportDeclWithMode, parseImportDeclWithComments
, NonGreedy(..)
, ListOf(..), unListOf
, getTopPragmas
, PragmasAndModuleName(..)
, PragmasAndModuleHead(..)
, ModuleHeadAndImports(..)
) where
import Data.Data hiding (Fixity)
import Language.Haskell.Exts.Fixity
import Language.Haskell.Exts.Syntax
import Language.Haskell.Exts.Comments
import Language.Haskell.Exts.InternalParser
import Language.Haskell.Exts.ParseMonad
import Language.Haskell.Exts.SrcLoc
instance Parseable (Decl SrcSpanInfo) where parser :: Maybe [Fixity] -> P (Decl SrcSpanInfo)
parser = P (Decl SrcSpanInfo) -> Maybe [Fixity] -> P (Decl SrcSpanInfo)
forall (a :: * -> *).
AppFixity a =>
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParser P (Decl SrcSpanInfo)
mparseDecl
instance Parseable (Exp SrcSpanInfo) where parser :: Maybe [Fixity] -> P (Exp SrcSpanInfo)
parser = P (Exp SrcSpanInfo) -> Maybe [Fixity] -> P (Exp SrcSpanInfo)
forall (a :: * -> *).
AppFixity a =>
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParser P (Exp SrcSpanInfo)
mparseExp
instance Parseable (Module SrcSpanInfo) where parser :: Maybe [Fixity] -> P (Module SrcSpanInfo)
parser = P (Module SrcSpanInfo) -> Maybe [Fixity] -> P (Module SrcSpanInfo)
forall (a :: * -> *).
AppFixity a =>
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParser P (Module SrcSpanInfo)
mparseModule
instance Parseable (Pat SrcSpanInfo) where parser :: Maybe [Fixity] -> P (Pat SrcSpanInfo)
parser = P (Pat SrcSpanInfo) -> Maybe [Fixity] -> P (Pat SrcSpanInfo)
forall (a :: * -> *).
AppFixity a =>
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParser P (Pat SrcSpanInfo)
mparsePat
instance Parseable (Stmt SrcSpanInfo) where parser :: Maybe [Fixity] -> P (Stmt SrcSpanInfo)
parser = P (Stmt SrcSpanInfo) -> Maybe [Fixity] -> P (Stmt SrcSpanInfo)
forall (a :: * -> *).
AppFixity a =>
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParser P (Stmt SrcSpanInfo)
mparseStmt
instance Parseable (Type SrcSpanInfo) where parser :: Maybe [Fixity] -> P (Type SrcSpanInfo)
parser = P (Type SrcSpanInfo) -> Maybe [Fixity] -> P (Type SrcSpanInfo)
forall (a :: * -> *).
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParserNoFixity P (Type SrcSpanInfo)
mparseType
instance Parseable (ImportDecl SrcSpanInfo) where parser :: Maybe [Fixity] -> P (ImportDecl SrcSpanInfo)
parser = P (ImportDecl SrcSpanInfo)
-> Maybe [Fixity] -> P (ImportDecl SrcSpanInfo)
forall (a :: * -> *).
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParserNoFixity P (ImportDecl SrcSpanInfo)
mparseImportDecl
normalParser :: AppFixity a => P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParser :: P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParser P (a SrcSpanInfo)
p Maybe [Fixity]
Nothing = P (a SrcSpanInfo)
p
normalParser P (a SrcSpanInfo)
p (Just [Fixity]
fixs) = P (a SrcSpanInfo)
p P (a SrcSpanInfo)
-> (a SrcSpanInfo -> P (a SrcSpanInfo)) -> P (a SrcSpanInfo)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \a SrcSpanInfo
ast -> [Fixity] -> a SrcSpanInfo -> P (a SrcSpanInfo)
forall (ast :: * -> *) (m :: * -> *).
(AppFixity ast, MonadFail m) =>
[Fixity] -> ast SrcSpanInfo -> m (ast SrcSpanInfo)
applyFixities [Fixity]
fixs a SrcSpanInfo
ast P (a SrcSpanInfo) -> SrcLoc -> P (a SrcSpanInfo)
forall a. P a -> SrcLoc -> P a
`atSrcLoc` SrcLoc
noLoc
normalParserNoFixity :: P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParserNoFixity :: P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParserNoFixity P (a SrcSpanInfo)
p Maybe [Fixity]
_ = P (a SrcSpanInfo)
p
parseModule :: String -> ParseResult (Module SrcSpanInfo)
parseModule :: String -> ParseResult (Module SrcSpanInfo)
parseModule = String -> ParseResult (Module SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
parse
parseModuleWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)
parseModuleWithMode :: ParseMode -> String -> ParseResult (Module SrcSpanInfo)
parseModuleWithMode = ParseMode -> String -> ParseResult (Module SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
parseWithMode
parseModuleWithComments :: ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])
= ParseMode -> String -> ParseResult (Module SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
parseWithComments
parseExp :: String -> ParseResult (Exp SrcSpanInfo)
parseExp :: String -> ParseResult (Exp SrcSpanInfo)
parseExp = String -> ParseResult (Exp SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
parse
parseExpWithMode :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo)
parseExpWithMode :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo)
parseExpWithMode = ParseMode -> String -> ParseResult (Exp SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
parseWithMode
parseExpWithComments :: ParseMode -> String -> ParseResult (Exp SrcSpanInfo, [Comment])
= ParseMode -> String -> ParseResult (Exp SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
parseWithComments
parsePat :: String -> ParseResult (Pat SrcSpanInfo)
parsePat :: String -> ParseResult (Pat SrcSpanInfo)
parsePat = String -> ParseResult (Pat SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
parse
parsePatWithMode :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo)
parsePatWithMode :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo)
parsePatWithMode = ParseMode -> String -> ParseResult (Pat SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
parseWithMode
parsePatWithComments :: ParseMode -> String -> ParseResult (Pat SrcSpanInfo, [Comment])
= ParseMode -> String -> ParseResult (Pat SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
parseWithComments
parseDecl :: String -> ParseResult (Decl SrcSpanInfo)
parseDecl :: String -> ParseResult (Decl SrcSpanInfo)
parseDecl = String -> ParseResult (Decl SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
parse
parseDeclWithMode :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo)
parseDeclWithMode :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo)
parseDeclWithMode = ParseMode -> String -> ParseResult (Decl SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
parseWithMode
parseDeclWithComments :: ParseMode -> String -> ParseResult (Decl SrcSpanInfo, [Comment])
= ParseMode -> String -> ParseResult (Decl SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
parseWithComments
parseType :: String -> ParseResult (Type SrcSpanInfo)
parseType :: String -> ParseResult (Type SrcSpanInfo)
parseType = String -> ParseResult (Type SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
parse
parseTypeWithMode :: ParseMode -> String -> ParseResult (Type SrcSpanInfo)
parseTypeWithMode :: ParseMode -> String -> ParseResult (Type SrcSpanInfo)
parseTypeWithMode = ParseMode -> String -> ParseResult (Type SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
parseWithMode
parseTypeWithComments :: ParseMode -> String -> ParseResult (Type SrcSpanInfo, [Comment])
= ParseMode -> String -> ParseResult (Type SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
parseWithComments
parseStmt :: String -> ParseResult (Stmt SrcSpanInfo)
parseStmt :: String -> ParseResult (Stmt SrcSpanInfo)
parseStmt = String -> ParseResult (Stmt SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
parse
parseStmtWithMode :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo)
parseStmtWithMode :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo)
parseStmtWithMode = ParseMode -> String -> ParseResult (Stmt SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
parseWithMode
parseStmtWithComments :: ParseMode -> String -> ParseResult (Stmt SrcSpanInfo, [Comment])
= ParseMode -> String -> ParseResult (Stmt SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
parseWithComments
parseImportDecl :: String -> ParseResult (ImportDecl SrcSpanInfo)
parseImportDecl :: String -> ParseResult (ImportDecl SrcSpanInfo)
parseImportDecl = String -> ParseResult (ImportDecl SrcSpanInfo)
forall ast. Parseable ast => String -> ParseResult ast
parse
parseImportDeclWithMode :: ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo)
parseImportDeclWithMode :: ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo)
parseImportDeclWithMode = ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo)
forall ast. Parseable ast => ParseMode -> String -> ParseResult ast
parseWithMode
parseImportDeclWithComments :: ParseMode -> String -> ParseResult (ImportDecl SrcSpanInfo, [Comment])
= ParseMode
-> String -> ParseResult (ImportDecl SrcSpanInfo, [Comment])
forall ast.
Parseable ast =>
ParseMode -> String -> ParseResult (ast, [Comment])
parseWithComments
getTopPragmas :: String -> ParseResult [ModulePragma SrcSpanInfo]
getTopPragmas :: String -> ParseResult [ModulePragma SrcSpanInfo]
getTopPragmas = (NonGreedy (ListOf (ModulePragma SrcSpanInfo))
-> [ModulePragma SrcSpanInfo])
-> ParseResult (NonGreedy (ListOf (ModulePragma SrcSpanInfo)))
-> ParseResult [ModulePragma SrcSpanInfo]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (ListOf (ModulePragma SrcSpanInfo) -> [ModulePragma SrcSpanInfo]
forall a. ListOf a -> [a]
unListOf (ListOf (ModulePragma SrcSpanInfo) -> [ModulePragma SrcSpanInfo])
-> (NonGreedy (ListOf (ModulePragma SrcSpanInfo))
-> ListOf (ModulePragma SrcSpanInfo))
-> NonGreedy (ListOf (ModulePragma SrcSpanInfo))
-> [ModulePragma SrcSpanInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonGreedy (ListOf (ModulePragma SrcSpanInfo))
-> ListOf (ModulePragma SrcSpanInfo)
forall a. NonGreedy a -> a
unNonGreedy) (ParseResult (NonGreedy (ListOf (ModulePragma SrcSpanInfo)))
-> ParseResult [ModulePragma SrcSpanInfo])
-> (String
-> ParseResult (NonGreedy (ListOf (ModulePragma SrcSpanInfo))))
-> String
-> ParseResult [ModulePragma SrcSpanInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String
-> ParseResult (NonGreedy (ListOf (ModulePragma SrcSpanInfo)))
forall ast. Parseable ast => String -> ParseResult ast
parse
instance Parseable (NonGreedy (ListOf (ModulePragma SrcSpanInfo))) where
parser :: Maybe [Fixity] -> P (NonGreedy (ListOf (ModulePragma SrcSpanInfo)))
parser = P ([ModulePragma SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> Maybe [Fixity]
-> P (NonGreedy (ListOf (ModulePragma SrcSpanInfo)))
forall (a :: * -> *).
P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> Maybe [Fixity] -> P (NonGreedy (ListOf (a SrcSpanInfo)))
nglistParserNoFixity P ([ModulePragma SrcSpanInfo], [SrcSpan], SrcSpanInfo)
ngparseModulePragmas
nglistParserNoFixity :: P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo) -> Maybe [Fixity] -> P (NonGreedy (ListOf (a SrcSpanInfo)))
nglistParserNoFixity :: P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> Maybe [Fixity] -> P (NonGreedy (ListOf (a SrcSpanInfo)))
nglistParserNoFixity P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
f = (([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> NonGreedy (ListOf (a SrcSpanInfo)))
-> P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> P (NonGreedy (ListOf (a SrcSpanInfo)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (ListOf (a SrcSpanInfo) -> NonGreedy (ListOf (a SrcSpanInfo))
forall a. a -> NonGreedy a
NonGreedy (ListOf (a SrcSpanInfo) -> NonGreedy (ListOf (a SrcSpanInfo)))
-> (([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> ListOf (a SrcSpanInfo))
-> ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> NonGreedy (ListOf (a SrcSpanInfo))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo) -> ListOf (a SrcSpanInfo)
forall a. ([a], [SrcSpan], SrcSpanInfo) -> ListOf a
toListOf) (P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> P (NonGreedy (ListOf (a SrcSpanInfo))))
-> (Maybe [Fixity] -> P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo))
-> Maybe [Fixity]
-> P (NonGreedy (ListOf (a SrcSpanInfo)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> Maybe [Fixity] -> P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
forall (a :: * -> *).
P (a SrcSpanInfo) -> Maybe [Fixity] -> P (a SrcSpanInfo)
normalParserNoFixity P ([a SrcSpanInfo], [SrcSpan], SrcSpanInfo)
f
data PragmasAndModuleName l = PragmasAndModuleName l
[ModulePragma l]
(Maybe (ModuleName l))
deriving (PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
(PragmasAndModuleName l -> PragmasAndModuleName l -> Bool)
-> (PragmasAndModuleName l -> PragmasAndModuleName l -> Bool)
-> Eq (PragmasAndModuleName l)
forall l.
Eq l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
$c/= :: forall l.
Eq l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
== :: PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
$c== :: forall l.
Eq l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
Eq,Eq (PragmasAndModuleName l)
Eq (PragmasAndModuleName l)
-> (PragmasAndModuleName l -> PragmasAndModuleName l -> Ordering)
-> (PragmasAndModuleName l -> PragmasAndModuleName l -> Bool)
-> (PragmasAndModuleName l -> PragmasAndModuleName l -> Bool)
-> (PragmasAndModuleName l -> PragmasAndModuleName l -> Bool)
-> (PragmasAndModuleName l -> PragmasAndModuleName l -> Bool)
-> (PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l)
-> (PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l)
-> Ord (PragmasAndModuleName l)
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
PragmasAndModuleName l -> PragmasAndModuleName l -> Ordering
PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. Ord l => Eq (PragmasAndModuleName l)
forall l.
Ord l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
forall l.
Ord l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Ordering
forall l.
Ord l =>
PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l
min :: PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l
$cmin :: forall l.
Ord l =>
PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l
max :: PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l
$cmax :: forall l.
Ord l =>
PragmasAndModuleName l
-> PragmasAndModuleName l -> PragmasAndModuleName l
>= :: PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
$c>= :: forall l.
Ord l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
> :: PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
$c> :: forall l.
Ord l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
<= :: PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
$c<= :: forall l.
Ord l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
< :: PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
$c< :: forall l.
Ord l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Bool
compare :: PragmasAndModuleName l -> PragmasAndModuleName l -> Ordering
$ccompare :: forall l.
Ord l =>
PragmasAndModuleName l -> PragmasAndModuleName l -> Ordering
$cp1Ord :: forall l. Ord l => Eq (PragmasAndModuleName l)
Ord,Int -> PragmasAndModuleName l -> ShowS
[PragmasAndModuleName l] -> ShowS
PragmasAndModuleName l -> String
(Int -> PragmasAndModuleName l -> ShowS)
-> (PragmasAndModuleName l -> String)
-> ([PragmasAndModuleName l] -> ShowS)
-> Show (PragmasAndModuleName l)
forall l. Show l => Int -> PragmasAndModuleName l -> ShowS
forall l. Show l => [PragmasAndModuleName l] -> ShowS
forall l. Show l => PragmasAndModuleName l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PragmasAndModuleName l] -> ShowS
$cshowList :: forall l. Show l => [PragmasAndModuleName l] -> ShowS
show :: PragmasAndModuleName l -> String
$cshow :: forall l. Show l => PragmasAndModuleName l -> String
showsPrec :: Int -> PragmasAndModuleName l -> ShowS
$cshowsPrec :: forall l. Show l => Int -> PragmasAndModuleName l -> ShowS
Show,Typeable,Typeable (PragmasAndModuleName l)
DataType
Constr
Typeable (PragmasAndModuleName l)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleName l
-> c (PragmasAndModuleName l))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleName l))
-> (PragmasAndModuleName l -> Constr)
-> (PragmasAndModuleName l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (PragmasAndModuleName l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleName l)))
-> ((forall b. Data b => b -> b)
-> PragmasAndModuleName l -> PragmasAndModuleName l)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r)
-> (forall u.
(forall d. Data d => d -> u) -> PragmasAndModuleName l -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleName l -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l))
-> Data (PragmasAndModuleName l)
PragmasAndModuleName l -> DataType
PragmasAndModuleName l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleName l))
(forall b. Data b => b -> b)
-> PragmasAndModuleName l -> PragmasAndModuleName l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleName l
-> c (PragmasAndModuleName l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleName l)
forall l. Data l => Typeable (PragmasAndModuleName l)
forall l. Data l => PragmasAndModuleName l -> DataType
forall l. Data l => PragmasAndModuleName l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b)
-> PragmasAndModuleName l -> PragmasAndModuleName l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleName l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> PragmasAndModuleName l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleName l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleName l
-> c (PragmasAndModuleName l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleName l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleName l))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleName l -> u
forall u.
(forall d. Data d => d -> u) -> PragmasAndModuleName l -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleName l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleName l
-> c (PragmasAndModuleName l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleName l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleName l))
$cPragmasAndModuleName :: Constr
$tPragmasAndModuleName :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
gmapMp :: (forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
gmapM :: (forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleName l -> m (PragmasAndModuleName l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> PragmasAndModuleName l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleName l -> u
gmapQ :: (forall d. Data d => d -> u) -> PragmasAndModuleName l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> PragmasAndModuleName l -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleName l
-> r
gmapT :: (forall b. Data b => b -> b)
-> PragmasAndModuleName l -> PragmasAndModuleName l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b)
-> PragmasAndModuleName l -> PragmasAndModuleName l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleName l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleName l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleName l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleName l))
dataTypeOf :: PragmasAndModuleName l -> DataType
$cdataTypeOf :: forall l. Data l => PragmasAndModuleName l -> DataType
toConstr :: PragmasAndModuleName l -> Constr
$ctoConstr :: forall l. Data l => PragmasAndModuleName l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleName l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleName l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleName l
-> c (PragmasAndModuleName l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleName l
-> c (PragmasAndModuleName l)
$cp1Data :: forall l. Data l => Typeable (PragmasAndModuleName l)
Data)
instance Parseable (NonGreedy (PragmasAndModuleName SrcSpanInfo)) where
parser :: Maybe [Fixity] -> P (NonGreedy (PragmasAndModuleName SrcSpanInfo))
parser Maybe [Fixity]
_ = do
(([ModulePragma SrcSpanInfo]
pragmas, [SrcSpan]
pss, SrcSpanInfo
pl), Maybe (ModuleName SrcSpanInfo)
mn) <- P (([ModulePragma SrcSpanInfo], [SrcSpan], SrcSpanInfo),
Maybe (ModuleName SrcSpanInfo))
ngparsePragmasAndModuleName
let l :: SrcSpanInfo
l = SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo
combSpanMaybe (SrcSpanInfo
pl SrcSpanInfo -> [SrcSpan] -> SrcSpanInfo
<** [SrcSpan]
pss) ((ModuleName SrcSpanInfo -> SrcSpanInfo)
-> Maybe (ModuleName SrcSpanInfo) -> Maybe SrcSpanInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ModuleName SrcSpanInfo -> SrcSpanInfo
forall (ast :: * -> *) l. Annotated ast => ast l -> l
ann Maybe (ModuleName SrcSpanInfo)
mn)
NonGreedy (PragmasAndModuleName SrcSpanInfo)
-> P (NonGreedy (PragmasAndModuleName SrcSpanInfo))
forall (m :: * -> *) a. Monad m => a -> m a
return (NonGreedy (PragmasAndModuleName SrcSpanInfo)
-> P (NonGreedy (PragmasAndModuleName SrcSpanInfo)))
-> NonGreedy (PragmasAndModuleName SrcSpanInfo)
-> P (NonGreedy (PragmasAndModuleName SrcSpanInfo))
forall a b. (a -> b) -> a -> b
$ PragmasAndModuleName SrcSpanInfo
-> NonGreedy (PragmasAndModuleName SrcSpanInfo)
forall a. a -> NonGreedy a
NonGreedy (PragmasAndModuleName SrcSpanInfo
-> NonGreedy (PragmasAndModuleName SrcSpanInfo))
-> PragmasAndModuleName SrcSpanInfo
-> NonGreedy (PragmasAndModuleName SrcSpanInfo)
forall a b. (a -> b) -> a -> b
$ SrcSpanInfo
-> [ModulePragma SrcSpanInfo]
-> Maybe (ModuleName SrcSpanInfo)
-> PragmasAndModuleName SrcSpanInfo
forall l.
l
-> [ModulePragma l]
-> Maybe (ModuleName l)
-> PragmasAndModuleName l
PragmasAndModuleName SrcSpanInfo
l [ModulePragma SrcSpanInfo]
pragmas Maybe (ModuleName SrcSpanInfo)
mn
data PragmasAndModuleHead l = PragmasAndModuleHead l
[ModulePragma l]
(Maybe (ModuleHead l))
deriving (PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
(PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool)
-> (PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool)
-> Eq (PragmasAndModuleHead l)
forall l.
Eq l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
$c/= :: forall l.
Eq l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
== :: PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
$c== :: forall l.
Eq l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
Eq,Eq (PragmasAndModuleHead l)
Eq (PragmasAndModuleHead l)
-> (PragmasAndModuleHead l -> PragmasAndModuleHead l -> Ordering)
-> (PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool)
-> (PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool)
-> (PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool)
-> (PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool)
-> (PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l)
-> (PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l)
-> Ord (PragmasAndModuleHead l)
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Ordering
PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. Ord l => Eq (PragmasAndModuleHead l)
forall l.
Ord l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
forall l.
Ord l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Ordering
forall l.
Ord l =>
PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
min :: PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
$cmin :: forall l.
Ord l =>
PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
max :: PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
$cmax :: forall l.
Ord l =>
PragmasAndModuleHead l
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
>= :: PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
$c>= :: forall l.
Ord l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
> :: PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
$c> :: forall l.
Ord l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
<= :: PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
$c<= :: forall l.
Ord l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
< :: PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
$c< :: forall l.
Ord l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Bool
compare :: PragmasAndModuleHead l -> PragmasAndModuleHead l -> Ordering
$ccompare :: forall l.
Ord l =>
PragmasAndModuleHead l -> PragmasAndModuleHead l -> Ordering
$cp1Ord :: forall l. Ord l => Eq (PragmasAndModuleHead l)
Ord,Int -> PragmasAndModuleHead l -> ShowS
[PragmasAndModuleHead l] -> ShowS
PragmasAndModuleHead l -> String
(Int -> PragmasAndModuleHead l -> ShowS)
-> (PragmasAndModuleHead l -> String)
-> ([PragmasAndModuleHead l] -> ShowS)
-> Show (PragmasAndModuleHead l)
forall l. Show l => Int -> PragmasAndModuleHead l -> ShowS
forall l. Show l => [PragmasAndModuleHead l] -> ShowS
forall l. Show l => PragmasAndModuleHead l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PragmasAndModuleHead l] -> ShowS
$cshowList :: forall l. Show l => [PragmasAndModuleHead l] -> ShowS
show :: PragmasAndModuleHead l -> String
$cshow :: forall l. Show l => PragmasAndModuleHead l -> String
showsPrec :: Int -> PragmasAndModuleHead l -> ShowS
$cshowsPrec :: forall l. Show l => Int -> PragmasAndModuleHead l -> ShowS
Show,Typeable,Typeable (PragmasAndModuleHead l)
DataType
Constr
Typeable (PragmasAndModuleHead l)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleHead l
-> c (PragmasAndModuleHead l))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleHead l))
-> (PragmasAndModuleHead l -> Constr)
-> (PragmasAndModuleHead l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (PragmasAndModuleHead l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleHead l)))
-> ((forall b. Data b => b -> b)
-> PragmasAndModuleHead l -> PragmasAndModuleHead l)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r)
-> (forall u.
(forall d. Data d => d -> u) -> PragmasAndModuleHead l -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleHead l -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l))
-> Data (PragmasAndModuleHead l)
PragmasAndModuleHead l -> DataType
PragmasAndModuleHead l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleHead l))
(forall b. Data b => b -> b)
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleHead l
-> c (PragmasAndModuleHead l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleHead l)
forall l. Data l => Typeable (PragmasAndModuleHead l)
forall l. Data l => PragmasAndModuleHead l -> DataType
forall l. Data l => PragmasAndModuleHead l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b)
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleHead l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> PragmasAndModuleHead l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleHead l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleHead l
-> c (PragmasAndModuleHead l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleHead l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleHead l))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleHead l -> u
forall u.
(forall d. Data d => d -> u) -> PragmasAndModuleHead l -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleHead l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleHead l
-> c (PragmasAndModuleHead l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleHead l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleHead l))
$cPragmasAndModuleHead :: Constr
$tPragmasAndModuleHead :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
gmapMp :: (forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
gmapM :: (forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d)
-> PragmasAndModuleHead l -> m (PragmasAndModuleHead l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> PragmasAndModuleHead l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> PragmasAndModuleHead l -> u
gmapQ :: (forall d. Data d => d -> u) -> PragmasAndModuleHead l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> PragmasAndModuleHead l -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> PragmasAndModuleHead l
-> r
gmapT :: (forall b. Data b => b -> b)
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b)
-> PragmasAndModuleHead l -> PragmasAndModuleHead l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleHead l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (PragmasAndModuleHead l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleHead l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (PragmasAndModuleHead l))
dataTypeOf :: PragmasAndModuleHead l -> DataType
$cdataTypeOf :: forall l. Data l => PragmasAndModuleHead l -> DataType
toConstr :: PragmasAndModuleHead l -> Constr
$ctoConstr :: forall l. Data l => PragmasAndModuleHead l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleHead l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (PragmasAndModuleHead l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleHead l
-> c (PragmasAndModuleHead l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> PragmasAndModuleHead l
-> c (PragmasAndModuleHead l)
$cp1Data :: forall l. Data l => Typeable (PragmasAndModuleHead l)
Data)
instance Parseable (NonGreedy (PragmasAndModuleHead SrcSpanInfo)) where
parser :: Maybe [Fixity] -> P (NonGreedy (PragmasAndModuleHead SrcSpanInfo))
parser Maybe [Fixity]
_ = do
(([ModulePragma SrcSpanInfo]
pragmas, [SrcSpan]
pss, SrcSpanInfo
pl), Maybe (ModuleHead SrcSpanInfo)
mh) <- P (([ModulePragma SrcSpanInfo], [SrcSpan], SrcSpanInfo),
Maybe (ModuleHead SrcSpanInfo))
ngparsePragmasAndModuleHead
let l :: SrcSpanInfo
l = SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo
combSpanMaybe (SrcSpanInfo
pl SrcSpanInfo -> [SrcSpan] -> SrcSpanInfo
<** [SrcSpan]
pss) ((ModuleHead SrcSpanInfo -> SrcSpanInfo)
-> Maybe (ModuleHead SrcSpanInfo) -> Maybe SrcSpanInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ModuleHead SrcSpanInfo -> SrcSpanInfo
forall (ast :: * -> *) l. Annotated ast => ast l -> l
ann Maybe (ModuleHead SrcSpanInfo)
mh)
NonGreedy (PragmasAndModuleHead SrcSpanInfo)
-> P (NonGreedy (PragmasAndModuleHead SrcSpanInfo))
forall (m :: * -> *) a. Monad m => a -> m a
return (NonGreedy (PragmasAndModuleHead SrcSpanInfo)
-> P (NonGreedy (PragmasAndModuleHead SrcSpanInfo)))
-> NonGreedy (PragmasAndModuleHead SrcSpanInfo)
-> P (NonGreedy (PragmasAndModuleHead SrcSpanInfo))
forall a b. (a -> b) -> a -> b
$ PragmasAndModuleHead SrcSpanInfo
-> NonGreedy (PragmasAndModuleHead SrcSpanInfo)
forall a. a -> NonGreedy a
NonGreedy (PragmasAndModuleHead SrcSpanInfo
-> NonGreedy (PragmasAndModuleHead SrcSpanInfo))
-> PragmasAndModuleHead SrcSpanInfo
-> NonGreedy (PragmasAndModuleHead SrcSpanInfo)
forall a b. (a -> b) -> a -> b
$ SrcSpanInfo
-> [ModulePragma SrcSpanInfo]
-> Maybe (ModuleHead SrcSpanInfo)
-> PragmasAndModuleHead SrcSpanInfo
forall l.
l
-> [ModulePragma l]
-> Maybe (ModuleHead l)
-> PragmasAndModuleHead l
PragmasAndModuleHead SrcSpanInfo
l [ModulePragma SrcSpanInfo]
pragmas Maybe (ModuleHead SrcSpanInfo)
mh
data ModuleHeadAndImports l = ModuleHeadAndImports l
[ModulePragma l]
(Maybe (ModuleHead l))
[ImportDecl l]
deriving (ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
(ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool)
-> (ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool)
-> Eq (ModuleHeadAndImports l)
forall l.
Eq l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
$c/= :: forall l.
Eq l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
== :: ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
$c== :: forall l.
Eq l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
Eq,Eq (ModuleHeadAndImports l)
Eq (ModuleHeadAndImports l)
-> (ModuleHeadAndImports l -> ModuleHeadAndImports l -> Ordering)
-> (ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool)
-> (ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool)
-> (ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool)
-> (ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool)
-> (ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l)
-> (ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l)
-> Ord (ModuleHeadAndImports l)
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Ordering
ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. Ord l => Eq (ModuleHeadAndImports l)
forall l.
Ord l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
forall l.
Ord l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Ordering
forall l.
Ord l =>
ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
min :: ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
$cmin :: forall l.
Ord l =>
ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
max :: ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
$cmax :: forall l.
Ord l =>
ModuleHeadAndImports l
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
>= :: ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
$c>= :: forall l.
Ord l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
> :: ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
$c> :: forall l.
Ord l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
<= :: ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
$c<= :: forall l.
Ord l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
< :: ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
$c< :: forall l.
Ord l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Bool
compare :: ModuleHeadAndImports l -> ModuleHeadAndImports l -> Ordering
$ccompare :: forall l.
Ord l =>
ModuleHeadAndImports l -> ModuleHeadAndImports l -> Ordering
$cp1Ord :: forall l. Ord l => Eq (ModuleHeadAndImports l)
Ord,Int -> ModuleHeadAndImports l -> ShowS
[ModuleHeadAndImports l] -> ShowS
ModuleHeadAndImports l -> String
(Int -> ModuleHeadAndImports l -> ShowS)
-> (ModuleHeadAndImports l -> String)
-> ([ModuleHeadAndImports l] -> ShowS)
-> Show (ModuleHeadAndImports l)
forall l. Show l => Int -> ModuleHeadAndImports l -> ShowS
forall l. Show l => [ModuleHeadAndImports l] -> ShowS
forall l. Show l => ModuleHeadAndImports l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModuleHeadAndImports l] -> ShowS
$cshowList :: forall l. Show l => [ModuleHeadAndImports l] -> ShowS
show :: ModuleHeadAndImports l -> String
$cshow :: forall l. Show l => ModuleHeadAndImports l -> String
showsPrec :: Int -> ModuleHeadAndImports l -> ShowS
$cshowsPrec :: forall l. Show l => Int -> ModuleHeadAndImports l -> ShowS
Show,Typeable,Typeable (ModuleHeadAndImports l)
DataType
Constr
Typeable (ModuleHeadAndImports l)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModuleHeadAndImports l
-> c (ModuleHeadAndImports l))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ModuleHeadAndImports l))
-> (ModuleHeadAndImports l -> Constr)
-> (ModuleHeadAndImports l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (ModuleHeadAndImports l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ModuleHeadAndImports l)))
-> ((forall b. Data b => b -> b)
-> ModuleHeadAndImports l -> ModuleHeadAndImports l)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r)
-> (forall u.
(forall d. Data d => d -> u) -> ModuleHeadAndImports l -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> ModuleHeadAndImports l -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l))
-> Data (ModuleHeadAndImports l)
ModuleHeadAndImports l -> DataType
ModuleHeadAndImports l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (ModuleHeadAndImports l))
(forall b. Data b => b -> b)
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModuleHeadAndImports l
-> c (ModuleHeadAndImports l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ModuleHeadAndImports l)
forall l. Data l => Typeable (ModuleHeadAndImports l)
forall l. Data l => ModuleHeadAndImports l -> DataType
forall l. Data l => ModuleHeadAndImports l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b)
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> ModuleHeadAndImports l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> ModuleHeadAndImports l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ModuleHeadAndImports l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModuleHeadAndImports l
-> c (ModuleHeadAndImports l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ModuleHeadAndImports l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ModuleHeadAndImports l))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ModuleHeadAndImports l -> u
forall u.
(forall d. Data d => d -> u) -> ModuleHeadAndImports l -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ModuleHeadAndImports l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModuleHeadAndImports l
-> c (ModuleHeadAndImports l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ModuleHeadAndImports l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ModuleHeadAndImports l))
$cModuleHeadAndImports :: Constr
$tModuleHeadAndImports :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
gmapMp :: (forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
gmapM :: (forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d)
-> ModuleHeadAndImports l -> m (ModuleHeadAndImports l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleHeadAndImports l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> ModuleHeadAndImports l -> u
gmapQ :: (forall d. Data d => d -> u) -> ModuleHeadAndImports l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> ModuleHeadAndImports l -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModuleHeadAndImports l
-> r
gmapT :: (forall b. Data b => b -> b)
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b)
-> ModuleHeadAndImports l -> ModuleHeadAndImports l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ModuleHeadAndImports l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ModuleHeadAndImports l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (ModuleHeadAndImports l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ModuleHeadAndImports l))
dataTypeOf :: ModuleHeadAndImports l -> DataType
$cdataTypeOf :: forall l. Data l => ModuleHeadAndImports l -> DataType
toConstr :: ModuleHeadAndImports l -> Constr
$ctoConstr :: forall l. Data l => ModuleHeadAndImports l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ModuleHeadAndImports l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ModuleHeadAndImports l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModuleHeadAndImports l
-> c (ModuleHeadAndImports l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModuleHeadAndImports l
-> c (ModuleHeadAndImports l)
$cp1Data :: forall l. Data l => Typeable (ModuleHeadAndImports l)
Data)
instance Parseable (NonGreedy (ModuleHeadAndImports SrcSpanInfo)) where
parser :: Maybe [Fixity] -> P (NonGreedy (ModuleHeadAndImports SrcSpanInfo))
parser Maybe [Fixity]
_ = do
(([ModulePragma SrcSpanInfo]
pragmas, [SrcSpan]
pss, SrcSpanInfo
pl), Maybe (ModuleHead SrcSpanInfo)
mh, Maybe ([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo)
mimps) <- P (([ModulePragma SrcSpanInfo], [SrcSpan], SrcSpanInfo),
Maybe (ModuleHead SrcSpanInfo),
Maybe ([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo))
ngparseModuleHeadAndImports
let l :: SrcSpanInfo
l = (SrcSpanInfo
pl SrcSpanInfo -> [SrcSpan] -> SrcSpanInfo
<** [SrcSpan]
pss) SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo
`combSpanMaybe`
((ModuleHead SrcSpanInfo -> SrcSpanInfo)
-> Maybe (ModuleHead SrcSpanInfo) -> Maybe SrcSpanInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ModuleHead SrcSpanInfo -> SrcSpanInfo
forall (ast :: * -> *) l. Annotated ast => ast l -> l
ann Maybe (ModuleHead SrcSpanInfo)
mh) SrcSpanInfo -> Maybe SrcSpanInfo -> SrcSpanInfo
`combSpanMaybe`
((([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo) -> SrcSpanInfo)
-> Maybe ([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> Maybe SrcSpanInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\([ImportDecl SrcSpanInfo]
_, [SrcSpan]
iss, SrcSpanInfo
il) -> SrcSpanInfo
il SrcSpanInfo -> [SrcSpan] -> SrcSpanInfo
<** [SrcSpan]
iss) Maybe ([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo)
mimps)
imps :: [ImportDecl SrcSpanInfo]
imps = [ImportDecl SrcSpanInfo]
-> (([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> [ImportDecl SrcSpanInfo])
-> Maybe ([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo)
-> [ImportDecl SrcSpanInfo]
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] (\([ImportDecl SrcSpanInfo]
x, [SrcSpan]
_, SrcSpanInfo
_) -> [ImportDecl SrcSpanInfo]
x) Maybe ([ImportDecl SrcSpanInfo], [SrcSpan], SrcSpanInfo)
mimps
NonGreedy (ModuleHeadAndImports SrcSpanInfo)
-> P (NonGreedy (ModuleHeadAndImports SrcSpanInfo))
forall (m :: * -> *) a. Monad m => a -> m a
return (NonGreedy (ModuleHeadAndImports SrcSpanInfo)
-> P (NonGreedy (ModuleHeadAndImports SrcSpanInfo)))
-> NonGreedy (ModuleHeadAndImports SrcSpanInfo)
-> P (NonGreedy (ModuleHeadAndImports SrcSpanInfo))
forall a b. (a -> b) -> a -> b
$ ModuleHeadAndImports SrcSpanInfo
-> NonGreedy (ModuleHeadAndImports SrcSpanInfo)
forall a. a -> NonGreedy a
NonGreedy (ModuleHeadAndImports SrcSpanInfo
-> NonGreedy (ModuleHeadAndImports SrcSpanInfo))
-> ModuleHeadAndImports SrcSpanInfo
-> NonGreedy (ModuleHeadAndImports SrcSpanInfo)
forall a b. (a -> b) -> a -> b
$ SrcSpanInfo
-> [ModulePragma SrcSpanInfo]
-> Maybe (ModuleHead SrcSpanInfo)
-> [ImportDecl SrcSpanInfo]
-> ModuleHeadAndImports SrcSpanInfo
forall l.
l
-> [ModulePragma l]
-> Maybe (ModuleHead l)
-> [ImportDecl l]
-> ModuleHeadAndImports l
ModuleHeadAndImports SrcSpanInfo
l [ModulePragma SrcSpanInfo]
pragmas Maybe (ModuleHead SrcSpanInfo)
mh [ImportDecl SrcSpanInfo]
imps
newtype NonGreedy a = NonGreedy { NonGreedy a -> a
unNonGreedy :: a }
deriving (NonGreedy a -> NonGreedy a -> Bool
(NonGreedy a -> NonGreedy a -> Bool)
-> (NonGreedy a -> NonGreedy a -> Bool) -> Eq (NonGreedy a)
forall a. Eq a => NonGreedy a -> NonGreedy a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NonGreedy a -> NonGreedy a -> Bool
$c/= :: forall a. Eq a => NonGreedy a -> NonGreedy a -> Bool
== :: NonGreedy a -> NonGreedy a -> Bool
$c== :: forall a. Eq a => NonGreedy a -> NonGreedy a -> Bool
Eq,Eq (NonGreedy a)
Eq (NonGreedy a)
-> (NonGreedy a -> NonGreedy a -> Ordering)
-> (NonGreedy a -> NonGreedy a -> Bool)
-> (NonGreedy a -> NonGreedy a -> Bool)
-> (NonGreedy a -> NonGreedy a -> Bool)
-> (NonGreedy a -> NonGreedy a -> Bool)
-> (NonGreedy a -> NonGreedy a -> NonGreedy a)
-> (NonGreedy a -> NonGreedy a -> NonGreedy a)
-> Ord (NonGreedy a)
NonGreedy a -> NonGreedy a -> Bool
NonGreedy a -> NonGreedy a -> Ordering
NonGreedy a -> NonGreedy a -> NonGreedy a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (NonGreedy a)
forall a. Ord a => NonGreedy a -> NonGreedy a -> Bool
forall a. Ord a => NonGreedy a -> NonGreedy a -> Ordering
forall a. Ord a => NonGreedy a -> NonGreedy a -> NonGreedy a
min :: NonGreedy a -> NonGreedy a -> NonGreedy a
$cmin :: forall a. Ord a => NonGreedy a -> NonGreedy a -> NonGreedy a
max :: NonGreedy a -> NonGreedy a -> NonGreedy a
$cmax :: forall a. Ord a => NonGreedy a -> NonGreedy a -> NonGreedy a
>= :: NonGreedy a -> NonGreedy a -> Bool
$c>= :: forall a. Ord a => NonGreedy a -> NonGreedy a -> Bool
> :: NonGreedy a -> NonGreedy a -> Bool
$c> :: forall a. Ord a => NonGreedy a -> NonGreedy a -> Bool
<= :: NonGreedy a -> NonGreedy a -> Bool
$c<= :: forall a. Ord a => NonGreedy a -> NonGreedy a -> Bool
< :: NonGreedy a -> NonGreedy a -> Bool
$c< :: forall a. Ord a => NonGreedy a -> NonGreedy a -> Bool
compare :: NonGreedy a -> NonGreedy a -> Ordering
$ccompare :: forall a. Ord a => NonGreedy a -> NonGreedy a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (NonGreedy a)
Ord,Int -> NonGreedy a -> ShowS
[NonGreedy a] -> ShowS
NonGreedy a -> String
(Int -> NonGreedy a -> ShowS)
-> (NonGreedy a -> String)
-> ([NonGreedy a] -> ShowS)
-> Show (NonGreedy a)
forall a. Show a => Int -> NonGreedy a -> ShowS
forall a. Show a => [NonGreedy a] -> ShowS
forall a. Show a => NonGreedy a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NonGreedy a] -> ShowS
$cshowList :: forall a. Show a => [NonGreedy a] -> ShowS
show :: NonGreedy a -> String
$cshow :: forall a. Show a => NonGreedy a -> String
showsPrec :: Int -> NonGreedy a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> NonGreedy a -> ShowS
Show,Typeable,Typeable (NonGreedy a)
DataType
Constr
Typeable (NonGreedy a)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NonGreedy a -> c (NonGreedy a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NonGreedy a))
-> (NonGreedy a -> Constr)
-> (NonGreedy a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (NonGreedy a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NonGreedy a)))
-> ((forall b. Data b => b -> b) -> NonGreedy a -> NonGreedy a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r)
-> (forall u. (forall d. Data d => d -> u) -> NonGreedy a -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> NonGreedy a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a))
-> Data (NonGreedy a)
NonGreedy a -> DataType
NonGreedy a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (NonGreedy a))
(forall b. Data b => b -> b) -> NonGreedy a -> NonGreedy a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NonGreedy a -> c (NonGreedy a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NonGreedy a)
forall a. Data a => Typeable (NonGreedy a)
forall a. Data a => NonGreedy a -> DataType
forall a. Data a => NonGreedy a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> NonGreedy a -> NonGreedy a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> NonGreedy a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> NonGreedy a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NonGreedy a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NonGreedy a -> c (NonGreedy a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (NonGreedy a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NonGreedy a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> NonGreedy a -> u
forall u. (forall d. Data d => d -> u) -> NonGreedy a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NonGreedy a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NonGreedy a -> c (NonGreedy a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (NonGreedy a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NonGreedy a))
$cNonGreedy :: Constr
$tNonGreedy :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
gmapMp :: (forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
gmapM :: (forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> NonGreedy a -> m (NonGreedy a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> NonGreedy a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> NonGreedy a -> u
gmapQ :: (forall d. Data d => d -> u) -> NonGreedy a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> NonGreedy a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NonGreedy a -> r
gmapT :: (forall b. Data b => b -> b) -> NonGreedy a -> NonGreedy a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> NonGreedy a -> NonGreedy a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NonGreedy a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NonGreedy a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (NonGreedy a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (NonGreedy a))
dataTypeOf :: NonGreedy a -> DataType
$cdataTypeOf :: forall a. Data a => NonGreedy a -> DataType
toConstr :: NonGreedy a -> Constr
$ctoConstr :: forall a. Data a => NonGreedy a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NonGreedy a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NonGreedy a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NonGreedy a -> c (NonGreedy a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NonGreedy a -> c (NonGreedy a)
$cp1Data :: forall a. Data a => Typeable (NonGreedy a)
Data)
instance Functor NonGreedy where
fmap :: (a -> b) -> NonGreedy a -> NonGreedy b
fmap a -> b
f (NonGreedy a
x) = b -> NonGreedy b
forall a. a -> NonGreedy a
NonGreedy (a -> b
f a
x)
data ListOf a = ListOf SrcSpanInfo [a]
deriving (ListOf a -> ListOf a -> Bool
(ListOf a -> ListOf a -> Bool)
-> (ListOf a -> ListOf a -> Bool) -> Eq (ListOf a)
forall a. Eq a => ListOf a -> ListOf a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOf a -> ListOf a -> Bool
$c/= :: forall a. Eq a => ListOf a -> ListOf a -> Bool
== :: ListOf a -> ListOf a -> Bool
$c== :: forall a. Eq a => ListOf a -> ListOf a -> Bool
Eq,Eq (ListOf a)
Eq (ListOf a)
-> (ListOf a -> ListOf a -> Ordering)
-> (ListOf a -> ListOf a -> Bool)
-> (ListOf a -> ListOf a -> Bool)
-> (ListOf a -> ListOf a -> Bool)
-> (ListOf a -> ListOf a -> Bool)
-> (ListOf a -> ListOf a -> ListOf a)
-> (ListOf a -> ListOf a -> ListOf a)
-> Ord (ListOf a)
ListOf a -> ListOf a -> Bool
ListOf a -> ListOf a -> Ordering
ListOf a -> ListOf a -> ListOf a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (ListOf a)
forall a. Ord a => ListOf a -> ListOf a -> Bool
forall a. Ord a => ListOf a -> ListOf a -> Ordering
forall a. Ord a => ListOf a -> ListOf a -> ListOf a
min :: ListOf a -> ListOf a -> ListOf a
$cmin :: forall a. Ord a => ListOf a -> ListOf a -> ListOf a
max :: ListOf a -> ListOf a -> ListOf a
$cmax :: forall a. Ord a => ListOf a -> ListOf a -> ListOf a
>= :: ListOf a -> ListOf a -> Bool
$c>= :: forall a. Ord a => ListOf a -> ListOf a -> Bool
> :: ListOf a -> ListOf a -> Bool
$c> :: forall a. Ord a => ListOf a -> ListOf a -> Bool
<= :: ListOf a -> ListOf a -> Bool
$c<= :: forall a. Ord a => ListOf a -> ListOf a -> Bool
< :: ListOf a -> ListOf a -> Bool
$c< :: forall a. Ord a => ListOf a -> ListOf a -> Bool
compare :: ListOf a -> ListOf a -> Ordering
$ccompare :: forall a. Ord a => ListOf a -> ListOf a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (ListOf a)
Ord,Int -> ListOf a -> ShowS
[ListOf a] -> ShowS
ListOf a -> String
(Int -> ListOf a -> ShowS)
-> (ListOf a -> String) -> ([ListOf a] -> ShowS) -> Show (ListOf a)
forall a. Show a => Int -> ListOf a -> ShowS
forall a. Show a => [ListOf a] -> ShowS
forall a. Show a => ListOf a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOf a] -> ShowS
$cshowList :: forall a. Show a => [ListOf a] -> ShowS
show :: ListOf a -> String
$cshow :: forall a. Show a => ListOf a -> String
showsPrec :: Int -> ListOf a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> ListOf a -> ShowS
Show,Typeable,Typeable (ListOf a)
DataType
Constr
Typeable (ListOf a)
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListOf a -> c (ListOf a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ListOf a))
-> (ListOf a -> Constr)
-> (ListOf a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ListOf a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ListOf a)))
-> ((forall b. Data b => b -> b) -> ListOf a -> ListOf a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r)
-> (forall u. (forall d. Data d => d -> u) -> ListOf a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ListOf a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a))
-> Data (ListOf a)
ListOf a -> DataType
ListOf a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (ListOf a))
(forall b. Data b => b -> b) -> ListOf a -> ListOf a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListOf a -> c (ListOf a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ListOf a)
forall a. Data a => Typeable (ListOf a)
forall a. Data a => ListOf a -> DataType
forall a. Data a => ListOf a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> ListOf a -> ListOf a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ListOf a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> ListOf a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ListOf a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListOf a -> c (ListOf a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ListOf a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListOf a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ListOf a -> u
forall u. (forall d. Data d => d -> u) -> ListOf a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ListOf a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListOf a -> c (ListOf a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ListOf a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListOf a))
$cListOf :: Constr
$tListOf :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
gmapMp :: (forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
gmapM :: (forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> ListOf a -> m (ListOf a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> ListOf a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ListOf a -> u
gmapQ :: (forall d. Data d => d -> u) -> ListOf a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> ListOf a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ListOf a -> r
gmapT :: (forall b. Data b => b -> b) -> ListOf a -> ListOf a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> ListOf a -> ListOf a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListOf a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListOf a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (ListOf a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ListOf a))
dataTypeOf :: ListOf a -> DataType
$cdataTypeOf :: forall a. Data a => ListOf a -> DataType
toConstr :: ListOf a -> Constr
$ctoConstr :: forall a. Data a => ListOf a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ListOf a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ListOf a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListOf a -> c (ListOf a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ListOf a -> c (ListOf a)
$cp1Data :: forall a. Data a => Typeable (ListOf a)
Data,a -> ListOf b -> ListOf a
(a -> b) -> ListOf a -> ListOf b
(forall a b. (a -> b) -> ListOf a -> ListOf b)
-> (forall a b. a -> ListOf b -> ListOf a) -> Functor ListOf
forall a b. a -> ListOf b -> ListOf a
forall a b. (a -> b) -> ListOf a -> ListOf b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> ListOf b -> ListOf a
$c<$ :: forall a b. a -> ListOf b -> ListOf a
fmap :: (a -> b) -> ListOf a -> ListOf b
$cfmap :: forall a b. (a -> b) -> ListOf a -> ListOf b
Functor)
unListOf :: ListOf a -> [a]
unListOf :: ListOf a -> [a]
unListOf (ListOf SrcSpanInfo
_ [a]
xs) = [a]
xs
toListOf :: ([a], [SrcSpan], SrcSpanInfo) -> ListOf a
toListOf :: ([a], [SrcSpan], SrcSpanInfo) -> ListOf a
toListOf ([a]
xs, [SrcSpan]
ss, SrcSpanInfo
l) = SrcSpanInfo -> [a] -> ListOf a
forall a. SrcSpanInfo -> [a] -> ListOf a
ListOf (SrcSpan -> [SrcSpan] -> SrcSpanInfo
infoSpan (SrcSpanInfo -> SrcSpan
srcInfoSpan SrcSpanInfo
l) [SrcSpan]
ss) [a]
xs