Skip to content

Commit afcdba5

Browse files
authored
Add Miso.String.QQ. (#1101)
1 parent 6cb37a9 commit afcdba5

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

miso.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ library
175175
if flag (template-haskell) && !impl(ghcjs)
176176
exposed-modules:
177177
Miso.Lens.TH
178+
Miso.String.QQ
178179
build-depends:
179180
template-haskell < 2.24
180181

src/Miso/String/QQ.hs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-----------------------------------------------------------------------------
2+
{-# LANGUAGE CPP #-}
3+
{-# LANGUAGE QuasiQuotes #-}
4+
{-# LANGUAGE NamedFieldPuns #-}
5+
{-# LANGUAGE RecordWildCards #-}
6+
{-# LANGUAGE TemplateHaskell #-}
7+
-----------------------------------------------------------------------------
8+
{-# OPTIONS_GHC -Wno-duplicate-exports #-}
9+
-----------------------------------------------------------------------------
10+
-- |
11+
-- Module : Miso.String.QQ
12+
-- Copyright : (C) 2016-2025 David M. Johnson (@dmjio)
13+
-- License : BSD3-style (see the file LICENSE)
14+
-- Maintainer : David M. Johnson <[email protected]>
15+
-- Stability : experimental
16+
-- Portability : non-portable
17+
----------------------------------------------------------------------------
18+
module Miso.String.QQ
19+
( misoString
20+
) where
21+
----------------------------------------------------------------------------
22+
import Language.Haskell.TH.Quote
23+
----------------------------------------------------------------------------
24+
import Miso.String (toMisoString)
25+
----------------------------------------------------------------------------
26+
misoString :: QuasiQuoter
27+
misoString = QuasiQuoter
28+
{ quoteExp = \string -> [| toMisoString string |]
29+
, quotePat = \_ -> fail "quotePat: not implemented"
30+
, quoteType = \_ -> fail "quoteType: not implemented"
31+
, quoteDec = \_ -> fail "quoteDec: not implemented"
32+
}
33+
----------------------------------------------------------------------------

0 commit comments

Comments
 (0)