Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

README and documentation in QQ.hs updated to GHC 7-syntax

  • Loading branch information...
commit 400737506290512758adadde92e8d30b01acf047 1 parent ec233c2
@finnsson authored
Showing with 10 additions and 10 deletions.
  1. +4 −4 README.markdown
  2. +6 −6 src/Text/JSON/QQ.hs
View
8 README.markdown
@@ -9,21 +9,21 @@ This package expose the function `jsonQQ` that compile time converts json code i
and is used like
- myCode = [$jsonQQ| {age: 23, name: "Pelle", likes: ["mac","Haskell"] } |]
+ myCode = [jsonQQ| {age: 23, name: "Pelle", likes: ["mac","Haskell"] } |]
where it is important that
-* you got no space in `[$jsonQQ|` and
+* you got no space in `[jsonQQ|` and
* no additional code after `|]`.
The quasiquatation can also bind to variables like
- myCode = [$jsonQQ | {age: <| age |>, name: <| name |>} |]
+ myCode = [jsonQQ | {age: <| age |>, name: <| name |>} |]
where age = 34 :: Integer
name = "Pelle"
or contain Haskell code like
- myCode = [$jsonQQ | {age: <| age + 42 :: Integer |>, name: <| map toUpper name |>} |]
+ myCode = [jsonQQ | {age: <| age + 42 :: Integer |>, name: <| map toUpper name |>} |]
where age = 34 :: Integer
name = "Pelle"
View
12 src/Text/JSON/QQ.hs
@@ -7,17 +7,17 @@
--
-- and is used like
--
--- > myCode = [$jsonQQ| {age: 23, name: "Pelle", likes: ["mac","Haskell"] } |]
+-- > myCode = [jsonQQ| {age: 23, name: "Pelle", likes: ["mac","Haskell"] } |]
--
-- where it is important that
--
--- * you got no space in @[$jsonQQ|@ and
+-- * you got no space in @[jsonQQ|@ and
--
-- * no additional code after @|]@.
--
-- The quasiquatation can also bind to variables like
--
--- > myCode = [$jsonQQ| {age: <|age|>, name: <|name|>} |]
+-- > myCode = [jsonQQ| {age: <|age|>, name: <|name|>} |]
-- > where age = 34 :: Integer
-- > name = "Pelle"
--
@@ -25,17 +25,17 @@
--
-- You can also insert Haskell code:
--
--- > myCode = [$jsonQQ| {age: <|age + 34 :: Integer|>, name: <|map toUpper name|>} |]
+-- > myCode = [jsonQQ| {age: <|age + 34 :: Integer|>, name: <|map toUpper name|>} |]
-- > where age = 34 :: Integer
-- > name = "Pelle"
--
-- You can use a similar syntax if you want to insert a value of type JSValue like
--
--- > myCode = [$jsonQQ| {"age": <<age>>} |]
+-- > myCode = [jsonQQ| {"age": <<age>>} |]
--
-- If you want to replace the name of the key in a hash you'll use the $-syntax:
--
--- > foo = [$jsonQQ| {$bar: 42} |]
+-- > foo = [jsonQQ| {$bar: 42} |]
-- > bar = "age"
--
Please sign in to comment.
Something went wrong with that request. Please try again.