[Haskell-cafe] trying to use Tag Soup - fromAttrib

Daniel Fischer daniel.is.fischer at web.de
Tue Nov 2 17:23:59 EDT 2010


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 is the right thing to use. But
> I'm having difficulty understanding the type signature
> fromAttrib :: (Show str, Eq str, StringLike str) => str -> Tag str ->
> str
>
> I'm sure if I did, the way to use it would be clear. Could someone
> help me make sense of this?

In most uses, str will be one of

- String
- ByteString
- Text

substitute the one you're using for str.

I've no idea why there's a Show constraint (except perhaps it's needed for 
a failure message).



More information about the Haskell-Cafe mailing list