git.iko.soy/typeable/html-parse
on master help sign in
typeable/html-parse/html-parse.cabal
105 lines 4.1 kB history raw
1name: html-parse
2version: 0.2.1.0
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 80
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 186.1 ms (175.3 ms .. 194.6 ms)
27 0.999 R² (0.995 R² .. 1.000 R²)
28 mean 191.7 ms (188.9 ms .. 198.3 ms)
29 std dev 5.053 ms (1.092 ms .. 6.809 ms)
30 variance introduced by outliers: 14% (moderately inflated)
31 .
32 benchmarking Forced/tagsoup normal Text
33 time 189.7 ms (182.8 ms .. 197.7 ms)
34 0.999 R² (0.998 R² .. 1.000 R²)
35 mean 196.5 ms (193.1 ms .. 202.1 ms)
36 std dev 5.481 ms (2.141 ms .. 7.383 ms)
37 variance introduced by outliers: 14% (moderately inflated)
38 .
39 benchmarking Forced/html-parser
40 time 15.81 ms (15.75 ms .. 15.89 ms)
41 1.000 R² (1.000 R² .. 1.000 R²)
42 mean 15.72 ms (15.66 ms .. 15.77 ms)
43 std dev 140.9 μs (113.6 μs .. 174.5 μ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.4.*, GHC==8.6.*, GHC==8.8.*, GHC==8.10.*, GHC==9.0.*, GHC==9.2.*, GHC==9.4.*, GHC==9.6.*
56extra-source-files: changelog.md
59source-repository head
60 type: git
61 location: git://github.com/bgamari/html-parse
63library
64 exposed-modules: Text.HTML.Parser, Text.HTML.Tree
65 other-modules: Text.HTML.Parser.Entities, Data.Trie
66 ghc-options: -Wall
67 hs-source-dirs: src
68 other-extensions: OverloadedStrings, DeriveGeneric
69 build-depends: base >=4.7 && <4.19,
70 deepseq >=1.3 && <1.5,
71 attoparsec >=0.13 && <0.15,
72 text >=1.2 && <2.1,
73 containers >=0.5 && <0.7
74 default-language: Haskell2010
76benchmark bench
77 type: exitcode-stdio-1.0
78 main-is: Benchmark.hs
79 other-extensions: OverloadedStrings, DeriveGeneric
80 build-depends: base,
81 deepseq,
82 attoparsec,
83 text,
84 tagsoup >= 0.13,
85 criterion >= 1.1,
86 html-parse
87 default-language: Haskell2010
89test-suite spec
90 type: exitcode-stdio-1.0
91 hs-source-dirs: tests
92 main-is: Spec.hs
93 other-modules: Text.HTML.ParserSpec, Text.HTML.TreeSpec
94 ghc-options: -Wall -with-rtsopts=-T
95 build-tool-depends: hspec-discover:hspec-discover
96 build-depends: base,
97 containers,
98 hspec,
99 hspec-discover,
100 html-parse,
101 QuickCheck,
102 quickcheck-instances,
103 string-conversions,
104 text
105 default-language: Haskell2010