Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- exonError :: ToString e => MonadFail m => e -> m a
- segmentsQ :: QOrIO m => String -> m (NonEmpty RawSegment)
- class Quasi m => QOrIO (m :: Type -> Type) where
- fileExtensions :: m [Extension]
- reifyExp :: QOrIO m => String -> m Exp
- reifySegments :: QOrIO m => NonEmpty RawSegment -> m (NonEmpty Exp)
- quoteExp :: QOrIO m => String -> m Exp
- exon :: QuasiQuoter
Documentation
class Quasi m => QOrIO (m :: Type -> Type) where Source #
fileExtensions :: m [Extension] Source #
Instances
QOrIO IO Source # | |
Defined in Exon.Quote fileExtensions :: IO [Extension] Source # | |
QOrIO Q Source # | |
Defined in Exon.Quote fileExtensions :: Q [Extension] Source # |
reifySegments :: QOrIO m => NonEmpty RawSegment -> m (NonEmpty Exp) Source #
exon :: QuasiQuoter Source #
A quasiquoter that allows interpolation, concatenating the resulting segments monoidally.
>>>
[exon|write #{show @Text (5 :: Int)} lines of code|] :: Text
"write 5 lines of code"
The default implementation for any non-stringly type uses IsString
to construct the literal segments and mappend
to combine them, ignoring whitespace segments.
>>>
newtype Part = Part Text deriving newtype (Show, Semigroup, Monoid, IsString)
>>>
[exon|x #{Part "y"}z|] :: Part
Part "xyz"
This behavior can be customized by writing an instance of Exon
.