File: QuasiQuote.hs

package info (click to toggle)
haskell-ghc-exactprint 1.7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,044 kB
  • sloc: haskell: 32,076; makefile: 7
file content (31 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{-# LANGUAGE QuasiQuotes #-}
module QuasiQuote where

import T7918A

ex1 = [qq|e1|]
ex2 = [qq|e2|]
ex3 = [qq|e3|]
ex4 = [qq|e4|]

tx1 = undefined :: [qq|t1|]
tx2 = undefined :: [qq|t2|]
tx3 = undefined :: [qq|t3|]
tx4 = undefined :: [qq|t4|]

px1 [qq|p1|] = undefined
px2 [qq|p2|] = undefined
px3 [qq|p3|] = undefined
px4 [qq|p4|] = undefined

{-# LANGUAGE QuasiQuotes #-}

testComplex    = assertBool "" ([$istr|
        ok
#{Foo 4 "Great!" : [Foo 3 "Scott!"]}
        then
|] == ("\n" ++
    "        ok\n" ++
    "[Foo 4 \"Great!\",Foo 3 \"Scott!\"]\n" ++
    "        then\n"))