git.iko.soy/typeable/html-parse
on daf3127 help sign in
typeable/html-parse/html-parse.cabal
100 lines 3.8 kB history raw
1name: html-parse
2version: 0.2.0.1
3synopsis: A high-performance HTML tokenizer
4description:
5 This package provides a fast and reasonably robust HTML5 tokenizer built
6 upon the @attoparsec@ library. The parsing strategy is based upon the HTML5
7 parsing specification with few deviations.
8 .
9 For instance,
10 .
11 >>> parseTokens "<div><h1 class=widget>Hello World</h1><br/>"
12 [TagOpen "div" [],
13 TagOpen "h1" [Attr "class" "widget"],
14 ContentText "Hello World",
15 TagClose "h1",
16 TagSelfClose "br" []]
17 .
18 The package targets similar use-cases to the venerable @tagsoup@ library,
19 but is significantly more efficient, achieving parsing speeds of over 50
20 megabytes per second on modern hardware and typical web documents.
21 Here are some typical performance numbers taken from parsing a Wikipedia
22 article of moderate length:
23 .
24 @
25 benchmarking Forced/tagsoup fast Text
26 time 171.2 ms (166.4 ms .. 177.3 ms)
27 0.999 R² (0.997 R² .. 1.000 R²)
28 mean 171.9 ms (169.4 ms .. 173.2 ms)
29 std dev 2.516 ms (1.104 ms .. 3.558 ms)
30 variance introduced by outliers: 12% (moderately inflated)
31 .
32 benchmarking Forced/tagsoup normal Text
33 time 176.9 ms (167.3 ms .. 188.5 ms)
34 0.998 R² (0.994 R² .. 1.000 R²)
35 mean 180.7 ms (177.5 ms .. 183.7 ms)
36 std dev 4.246 ms (2.316 ms .. 5.803 ms)
37 variance introduced by outliers: 14% (moderately inflated)
38 .
39 benchmarking Forced/html-parser
40 time 20.88 ms (20.60 ms .. 21.25 ms)
41 0.999 R² (0.998 R² .. 0.999 R²)
42 mean 20.99 ms (20.81 ms .. 21.20 ms)
43 std dev 446.1 μs (336.4 μs .. 596.2 μs)
44 @
46homepage: http://github.com/bgamari/html-parse
47license: BSD3
48license-file: LICENSE
49author: Ben Gamari
50maintainer: ben@smart-cactus.org
51copyright: (c) 2016 Ben Gamari
52category: Text
53build-type: Simple
54cabal-version: >=1.10
55tested-with: GHC==8.0.2, GHC==7.10.3, GHC==7.8.4
58source-repository head
59 type: git
60 location: git://github.com/bgamari/html-parse
62library
63 exposed-modules: Text.HTML.Parser, Text.HTML.Tree
64 ghc-options: -Wall
65 other-extensions: OverloadedStrings, DeriveGeneric
66 build-depends: base >=4.7 && <4.11,
67 deepseq >=1.3 && <1.5,
68 attoparsec >=0.13 && <0.14,
69 text >=1.2 && <1.3,
70 containers >=0.5 && <0.6
71 default-language: Haskell2010
73benchmark bench
74 type: exitcode-stdio-1.0
75 main-is: Benchmark.hs
76 other-extensions: OverloadedStrings, DeriveGeneric
77 build-depends: base,
78 deepseq,
79 attoparsec,
80 text,
81 tagsoup >= 0.13,
82 criterion >= 1.1
83 default-language: Haskell2010
85test-suite spec
86 type: exitcode-stdio-1.0
87 hs-source-dirs: tests
88 main-is: Spec.hs
89 other-modules: Text.HTML.ParserSpec, Text.HTML.TreeSpec
90 ghc-options: -Wall -with-rtsopts=-T
91 build-depends: base,
92 containers,
93 hspec,
94 hspec-discover,
95 html-parse,
96 QuickCheck,
97 quickcheck-instances,
98 string-conversions,
99 text
100 default-language: Haskell2010