Hi, I'm Vladimir Shabanov. Haskell programmer, founder of BazQux Reader.
vshabanov / fast-tagsoup Goto Github PK
View Code? Open in Web Editor NEWFast Haskell tagsoup parser
License: BSD 3-Clause "New" or "Revised" License
Fast Haskell tagsoup parser
License: BSD 3-Clause "New" or "Revised" License
Hi, I'm Vladimir Shabanov. Haskell programmer, founder of BazQux Reader.
Updating fast-tagsoup to 1.0.5 gives me a build failure:
Configuring fast-tagsoup-1.0.5...
Building fast-tagsoup-1.0.5...
Preprocessing library fast-tagsoup-1.0.5...
[1 of 1] Compiling Text.HTML.TagSoup.Fast ( Text/HTML/TagSoup/Fast.hs, dist/build/Text/HTML/TagSoup/Fast.o )
Text/HTML/TagSoup/Fast.hs:302:24:
Couldn't match expected type `Char' with actual type `[Char]'
In the pattern: [i]
In the pattern: Just [i]
In a case alternative:
Just [i]
-> do { let put !d [] = ...
put !d (x : xs) = ...;
put d $ encodeChar i }
Failed to install fast-tagsoup-1.0.5
Going back to 1.0.4 resolves the issue.
Here is a problem I ran into...
I tried to define a instance for TagRep ByteString
like this:
import Text.HTML.TagSoup hiding (parseTags, renderTags, (~==))
import qualified Text.HTML.TagSoup as TS
import Text.HTML.TagSoup.Fast
import qualified Data.ByteString.Char8 as BS
...
instance TagRep ByteString where
toTagRep x = case parseTags x of
[a] -> toTagRep a
_ -> error $ "When using a TagRep it must be exactly one tag, you gave: " ++ BS.unpack x
and parseTags $ (BS.pack "<td class=s")
didn't create the correct tag.
However, things worked if I changed the instance definition to use TS.parseTags
instead of the parseTags
from the fast package:
instance TagRep ByteString where
toTagRep x = case TS.parseTags x of
[a] -> toTagRep a
_ -> error ...
it worked correctly.
Is it possible to disable converting tags to lower case (for example by some param) - It's not useful for XML
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.