| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 07:24:53 GMT
X-Served-By: cache-dfw-ktki8620086-DFW, cache-bom-vanm7210074-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768634693.036135,VS0,VE290
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
svg-builder: DSL for building SVG.
svg-builder
svg-builder: DSL for building SVG.
Modules
[Index]
Downloads
- svg-builder-0.1.1.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1, 0.1.0.1, 0.1.0.2, 0.1.1 |
|---|---|
| Dependencies | base (>=4.5 && <4.22), blaze-builder (>=0.4 && <0.5), bytestring (>=0.10 && <0.13), hashable (>=1.1 && <1.6), semigroups (>=0.16.1 && <0.20), text (>=0.11 && <2.2), unordered-containers (>=0.2 && <0.3) [details] |
| Tested with | ghc ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.5 || ==9.8.2 || ==9.10.1 || ==9.12.1 |
| License | BSD-3-Clause |
| Copyright | 2016 Jeffrey Rosenbluth |
| Author | Jeffrey Rosenbluth |
| Maintainer | jeffrey.rosenbluth@gmail.com |
| Uploaded | by BrentYorgey at 2018-05-10T03:09:58Z |
| Revised | Revision 11 made by BrentYorgey at 2025-03-22T15:37:21Z |
| Category | Graphics |
| Home page | https://github.com/diagrams/svg-builder.git |
| Source repo | head: git clone https://github.com/diagrams/svg-builder.git |
| Distributions | Arch:0.1.1, Debian:0.1.1, LTSHaskell:0.1.1, NixOS:0.1.1, Stackage:0.1.1 |
| Reverse Dependencies | 11 direct, 75 indirect [details] |
| Downloads | 16559 total (21 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2018-05-10 [all 1 reports] |
Readme for svg-builder-0.1.1
[back to package description]svg-builder 
Simple DSL for writing fast SVG.
Example
{-# LANGUAGE OverloadedStrings #-}
import Graphics.Svg
svg :: Element -> Element
svg content =
doctype
<> with (svg11_ content) [Version_ <<- "1.1", Width_ <<- "300", Height_ <<- "200"]
contents :: Element
contents =
rect_ [ Width_ <<- "100%", Height_ <<- "100%", "red" ->> Fill_]
<> circle_ [ Cx_ <<- "150", Cy_ <<- "100", R_ <<- "80", Fill_ <<- "green"]
<> text_ [ X_ <<- "150", Y_ <<- "125", Font_size_ <<- "60"
, Text_anchor_ <<- "middle", Fill_ <<- "white"] "SVG"
main :: IO ()
main = do
print $ svg contents

Haskell logo
{-# LANGUAGE OverloadedStrings #-}
import Graphics.Svg
svg :: Element -> Element
svg content =
doctype
<> with (svg11_ content) [Version_ <<- "1.1", Width_ <<- "482", Height_ <<- "340"]
logo :: Element
logo =
path_ [ Fill_ <<- "#352950"
, D_ <<- ( mA 0 340 <> lA 113 170 <> lA 0 0 <> lA 85 0
<> lA 198 170 <> lA 85 340 <> lA 0 340 <> z <> mA 0 340 ) ]
<> path_ [ Fill_ <<- "#4A3A74"
, D_ <<- ( mA 113 340 <> lA 226 170 <> lA 113 0 <> lA 198 0
<> lA 425 340 <> lA 340 340 <> lA 269 234 <> lA 198 340
<> lA 113 340 <> z <> mA 113 340 ) ]
<> path_ [ Fill_ <<- "#7C3679"
, D_ <<- ( mA 387 241 <> lA 350 184 <> lA 482 184 <> lA 482 241
<> lA 387 241 <> z <> mA 387 241 ) ]
<> path_ [ Fill_ <<- "#7C3679"
, D_ <<- ( mA 331 156 <> lA 293 99 <> lA 482 99 <> lA 482 156
<> lA 331 156 <> z <> mA 331 156 ) ]
main :: IO ()
main = do
print $ svg logo
