| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Haskell.Template.Match
Synopsis
- data Where
- data What
- data Location
- data Result a
- newtype M a = M {}
- highlight_ssi :: SrcSpanInfo -> Int -> String -> [String]
- data DeclarationKind l
- type Decl' l b = (DeclarationKind l, b)
- partitionByKind :: Ord l => [Decl' l b] -> ([Decl' l b], [Decl' l b], [Decl' l b])
- failLoc :: forall a. M a
- continue :: forall a. M a
- onlyTemplate :: Annotated a => What -> a SrcSpanInfo -> Location
- onlySubmission :: Annotated a => What -> a SrcSpanInfo -> Location
- matchUndef :: forall a. Maybe (Exp a) -> Bool
- matchSrcSpanInfoSub :: (Data a, Data b) => What -> a -> b -> M ()
- matchSrcSpanInfo :: What -> Maybe SrcSpanInfo -> Maybe SrcSpanInfo -> M ()
- getFunctionName :: Decl l -> [(DeclarationKind l, Decl l)]
- matchList :: (Annotated a, Data (a SrcSpanInfo)) => What -> [a SrcSpanInfo] -> [a SrcSpanInfo] -> [Location]
- matchMaybe :: (Annotated a, Data (a SrcSpanInfo)) => What -> Maybe (a SrcSpanInfo) -> Maybe (a SrcSpanInfo) -> [Location]
- matchDecl :: [Decl SrcSpanInfo] -> [Decl SrcSpanInfo] -> [Location]
- go :: What -> [(DeclarationKind SrcSpanInfo, Decl SrcSpanInfo)] -> [(DeclarationKind SrcSpanInfo, Decl SrcSpanInfo)] -> [Location]
- withCast :: (Data a, Data b, Data t1, Data t2) => (t1 -> t2 -> [Location]) -> a -> b -> M c
- match :: Data a => What -> a -> GenericM M
- matchLocation :: (Data a, Data b) => What -> a -> b -> [Location]
- matchModule :: Module SrcSpanInfo -> Module SrcSpanInfo -> M ()
- test :: Module SrcSpanInfo -> Module SrcSpanInfo -> Result ()
- gzipWithM' :: Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)
- gmapAccumM' :: forall a d m. (Data d, Monad m) => (forall e. Data e => a -> e -> (a, m e)) -> a -> d -> (a, m d)
Documentation
Constructors
| OnlyTemplate | |
| OnlySubmission |
Constructors
| CompleteModule | |
| Declaration | |
| HeadOfModule | |
| ModuleImport | |
| Pragma |
Constructors
| SrcSpanInfo What Where SrcSpanInfo | |
| SrcSpanInfoPair What SrcSpanInfo SrcSpanInfo |
highlight_ssi :: SrcSpanInfo -> Int -> String -> [String] Source #
underline the part of the input that is in the span, and add some lines of contexts before and after. Returns lines.
data DeclarationKind l Source #
Constructors
| TypeDeclaration | |
| FunctionDeclaration | |
| Unnamed | |
Instances
| Eq (DeclarationKind l) Source # | |
Defined in Haskell.Template.Match Methods (==) :: DeclarationKind l -> DeclarationKind l -> Bool # (/=) :: DeclarationKind l -> DeclarationKind l -> Bool # | |
| Ord l => Ord (DeclarationKind l) Source # | |
Defined in Haskell.Template.Match Methods compare :: DeclarationKind l -> DeclarationKind l -> Ordering # (<) :: DeclarationKind l -> DeclarationKind l -> Bool # (<=) :: DeclarationKind l -> DeclarationKind l -> Bool # (>) :: DeclarationKind l -> DeclarationKind l -> Bool # (>=) :: DeclarationKind l -> DeclarationKind l -> Bool # max :: DeclarationKind l -> DeclarationKind l -> DeclarationKind l # min :: DeclarationKind l -> DeclarationKind l -> DeclarationKind l # | |
type Decl' l b = (DeclarationKind l, b) Source #
onlyTemplate :: Annotated a => What -> a SrcSpanInfo -> Location Source #
onlySubmission :: Annotated a => What -> a SrcSpanInfo -> Location Source #
matchSrcSpanInfoSub :: (Data a, Data b) => What -> a -> b -> M () Source #
Stores src span locations in state.
In contrast to matchSrcSpanInfo it checks also arguments of constructors for
existing SrcSpanInfo.
(uses matchSrcSpanInfo)
matchSrcSpanInfo :: What -> Maybe SrcSpanInfo -> Maybe SrcSpanInfo -> M () Source #
getFunctionName :: Decl l -> [(DeclarationKind l, Decl l)] Source #
matchList :: (Annotated a, Data (a SrcSpanInfo)) => What -> [a SrcSpanInfo] -> [a SrcSpanInfo] -> [Location] Source #
matchMaybe :: (Annotated a, Data (a SrcSpanInfo)) => What -> Maybe (a SrcSpanInfo) -> Maybe (a SrcSpanInfo) -> [Location] Source #
matchDecl :: [Decl SrcSpanInfo] -> [Decl SrcSpanInfo] -> [Location] Source #
go :: What -> [(DeclarationKind SrcSpanInfo, Decl SrcSpanInfo)] -> [(DeclarationKind SrcSpanInfo, Decl SrcSpanInfo)] -> [Location] Source #
withCast :: (Data a, Data b, Data t1, Data t2) => (t1 -> t2 -> [Location]) -> a -> b -> M c Source #
matchModule :: Module SrcSpanInfo -> Module SrcSpanInfo -> M () Source #
test :: Module SrcSpanInfo -> Module SrcSpanInfo -> Result () Source #
test whether m2 is a suitable template for m1
in case of an error, the returned '[Location]' gives the mismatching
positions in the template