Hi
I have this basic question of how to print the character " without
the backslash.
I'm trying to print html code, so i need " a lot.
giveHtml (Leaf (a,(b,c))) = "<frame src=\"\" name=\"" ++ [a] ++ "\"
scrolling=\"No\" noresize=\"noresize\" id=\"" ++ [a] ++ "\" title=\""
++ [a] ++ "\" />"
Can anybody give me a light here?
Yes, use the fact that HTML (and Javascript) both allow either " or '
as their string character.
giveHtml (Leaf (a,(b,c))) = "<frame src='' name='" ++ [a] ++ "'
scrolling='No' noresize='noresize' id='" ++ [a] ++ "' title='"
++ [a] ++ "' />"
Less escape characters all round :)
You can even (if you wish) write a singleToDouble function that
replaced all ' with ", but its not necessary when generating HTML.
Thanks
Neil
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe