In short, Q provides the Quasi operations in one neat monad for the user.
The longer story, is that Q wraps an arbitrary Quasi-able monad. The perceptive reader notices that Quasi has only two instances, Q itself and IO, neither of which have concrete implementations.Q plays the trick of dependency inversion, providing an abstract interface for the user which is later concretely fufilled by an concrete Quasi instance, internal to GHC.
Instances10Monad, Functor, MonadFix, MonadFail, Applicative, Quote, …
Monad QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxFunctor QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxMonadFix QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxIf the function passed to mfix inspects its argument, the resulting action will throw a FixIOException.
MonadFail QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxApplicative QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxQuote QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxMonadIO QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxQuasi QDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxSemigroup a => Semigroup (Q a)Defined in ghc-internal-9.1401.0 · GHC.Internal.TH.SyntaxMonoid a => Monoid (Q a)Defined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax