Hi Michael,
If you just replace all 'str' with 'String' when reading the signature
then that will almost certainly be sufficient for your purposes. So
read it as:
fromAttrib :: String -> Tag String -> String
Where "Tag String" can be thought of as just "Tag". If you try to
parse HTML with regula
Ah thank you. I can go ahead and figure out how to parse that string.
Using a regex is tempting but I have a feeling I can get something
more maintainable if I use another approach.
On Tue, Nov 2, 2010 at 2:52 PM, Daniel Schoepe
wrote:
> Excerpts from Michael Litchard's message of Tue Nov 02 22:4
Excerpts from Michael Litchard's message of Tue Nov 02 22:40:27 +0100 2010:
> Daniel,
>Thank you for your reply. I'm still confused.
> When I see a code sample like this
> main = do
> posts <- liftM parseTags (readFile "posts.xml")
> print $ head $ map (fromAttrib "Id") $
>
On 2 November 2010 22:40, Michael Litchard wrote:
> fromAttrib :: (Show str, Eq str, StringLike str) => str -> Tag str -> str
>
> seems to say "fromAttrib takes two parameters (I know it doesn't
> literally take two), one str (with the constraints in parenthesis to
> the left) and one str of type
Daniel,
Thank you for your reply. I'm still confused.
When I see a code sample like this
main = do
posts <- liftM parseTags (readFile "posts.xml")
print $ head $ map (fromAttrib "Id") $
filter (~== (""))
posts
I have no idea how to match that up wit
On Tuesday 02 November 2010 22:17:48, Michael Litchard wrote:
> I have the following TagOpen
> [TagOpen "a"
> [("href","/launchWebForward.do?resourceId=4&policy=0&returnTo=%2FshowWeb
>Forwards.do")]]
>
> I would like to get the attribute resourceId=4 from that. My
> understanding is that fromAttrib