Safe Haskell | None |
---|---|
Language | Haskell2010 |
Custom SYB traversals
Synopsis
- everythingContaining :: forall r. Monoid r => SrcSpan -> GenericQ r -> GenericQ r
- genericIsSubspan :: SrcSpan -> GenericQ (Maybe Bool)
- mkQ1 :: forall a r f. (Data a, Data (f ())) => f () -> r -> (forall b. f b -> r) -> a -> r
- sameTypeModuloLastApp :: forall a b. (Typeable a, Typeable b) => Bool
- metaprogramAtQ :: SrcSpan -> GenericQ [(SrcSpan, Text)]
- metaprogramQ :: GenericQ [(SrcSpan, Text)]
Documentation
everythingContaining :: forall r. Monoid r => SrcSpan -> GenericQ r -> GenericQ r Source #
Like everything
, but only looks inside Located
terms that contain the
given SrcSpan
.
genericIsSubspan :: SrcSpan -> GenericQ (Maybe Bool) Source #
Helper function for implementing everythingWithin
NOTE(sandy): Subtly broken. In an ideal world, this function shuld return
Just False
for nodes of any type which do not contain the span. But if
this functionality exists anywhere within the SYB machinery, I have yet to
find it.
:: forall a r f. (Data a, Data (f ())) | |
=> f () | Polymorphic constructor to match on |
-> r | Default value |
-> (forall b. f b -> r) | Polymorphic match |
-> a | |
-> r |
Like mkQ
, but allows for polymorphic instantiation of its specific case.
This instantation matches whenever the dynamic value has the same
constructor as the proxy f ()
value.