exon 1.0.0.1 → 1.0.0.2
raw patch · 3 files changed
+46/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog.md +15/−0
- exon.cabal +4/−1
- readme.md +27/−0
+ changelog.md view
@@ -0,0 +1,15 @@+# 1.0.0.0++* Rewrite the main logic, splitting it across multiple classes.+* Automatically unwrap `Generic` newtype segments.+* Use builders like `Text.Builder`, unwrapping `Generic` newtypes of the result type.+* Don't treat whitespace as special in the default quoter.++# 0.2.0.0++* Add `exonws`, a variant that preserves whitespace.+* Add `exonWith`, a constructor for custom quasiquoters.++# 0.1.1.0++* Add `Exon` instance for `String -> String`, used by `showsPrec`.
exon.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: exon-version: 1.0.0.1+version: 1.0.0.2 synopsis: Customizable Quasiquote Interpolation description: See https://hackage.haskell.org/package/exon/docs/Exon.html category: String@@ -17,6 +17,9 @@ license: BSD-2-Clause-Patent license-file: LICENSE build-type: Simple+extra-source-files:+ changelog.md+ readme.md source-repository head type: git
+ readme.md view
@@ -0,0 +1,27 @@+This Haskell library provides string interpolation in quasiquotes, allowing you to build strings like this:++```haskell+animal = "snake"+location = "a tree"+[exon|#{animal} in #{location}|]+-- "snake in a tree"+```++Each step of the process is customizable based on the result type of the quote, making it possible to construct strings+for arbitrary types.+For example, `String -> String` is the type used by `showsPrec`, which can be a bit of a hassle to write:++```haskell+data Record =+ Record {+ number :: Int,+ maybeNumber :: Maybe Int,+ value :: Value+ }++instance Show Record where+ showsPrec d Record {..} =+ showParen (d > 10) [exon|Record #{showsPrec 11 number} #{showsPrec 11 maybeNumber} #{showsPrec 11 value}|]+```++[hackage]: https://hackage.haskell.org/package/exon/docs/Exon.html