HORIZON HASKELLDocslts/ghc-10.0.x04404a62026-10-19Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 04404a6 · 2026-10-19

Moduletemplate-haskell-2.25.0.0Haskell2010

Language.Haskell.TH.CodeDo

This module exists to work nicely with the QualifiedDo extension.

import qualified Language.Haskell.TH.CodeDo as Code

myExample :: Monad m => Code m a -> Code m a -> Code m a
myExample opt1 opt2 =
  Code.do
   x <- someSideEffect               -- This one is of type `M Bool`
   if x then opt1 else opt2
Synopsis