----------------------------------------------------------------------------- {-# LANGUAGE CPP #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} ----------------------------------------------------------------------------- {-# OPTIONS_GHC -Wno-duplicate-exports #-} ----------------------------------------------------------------------------- -- | -- Module : Miso.String.QQ -- Copyright : (C) 2016-2025 David M. Johnson (@dmjio) -- License : BSD3-style (see the file LICENSE) -- Maintainer : David M. Johnson <code@dmj.io> -- Stability : experimental -- Portability : non-portable ---------------------------------------------------------------------------- module Miso.String.QQ ( misoString ) where ---------------------------------------------------------------------------- import Language.Haskell.TH.Quote ---------------------------------------------------------------------------- import Miso.String (toMisoString) ---------------------------------------------------------------------------- -- | QuasiQuoter for specifying multiline 'Miso.String.MisoString' -- -- @ -- {-# LANGUAGE QuasiQuotes #-} -- -- test :: MisoString -- test = [misoString| foo -- bar -- baz -- |] -- -- @ -- misoString :: QuasiQuoter misoString :: QuasiQuoter misoString = QuasiQuoter { quoteExp :: String -> Q Exp quoteExp = \String string -> [| toMisoString string |] , quotePat :: String -> Q Pat quotePat = \String _ -> String -> Q Pat forall a. String -> Q a forall (m :: * -> *) a. MonadFail m => String -> m a fail String "quotePat: not implemented" , quoteType :: String -> Q Type quoteType = \String _ -> String -> Q Type forall a. String -> Q a forall (m :: * -> *) a. MonadFail m => String -> m a fail String "quoteType: not implemented" , quoteDec :: String -> Q [Dec] quoteDec = \String _ -> String -> Q [Dec] forall a. String -> Q a forall (m :: * -> *) a. MonadFail m => String -> m a fail String "quoteDec: not implemented" } ----------------------------------------------------------------------------