Created
February 1, 2010 15:23
-
-
Save h-hirai/291745 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data XMLItem = XMLElem String [(String, String)] [XMLItem] | |
| Text String | |
attrsShow as = concat [" " ++ k ++ "=\"" ++ v ++ "\"" | (k, v) <- as] | |
instance Show XMLItem where | |
show (Text s) = s | |
show (XMLElem tag as []) = "<" ++ tag ++ attrsShow as ++ " />" | |
show (XMLElem tag as cs) = "<" ++ tag ++ attrsShow as ++ ">" ++ | |
concatMap show cs ++ | |
"</" ++ tag ++ ">" | |
arrowHead = XMLElem "defs" [] [ | |
XMLElem "marker" [("id","Triangle"), | |
("viewBox","0 0 10 10"), | |
("refX","0"), | |
("refX","5"), | |
("markerUnits","strokeWidth"), | |
("markerWidth","4"), | |
("markerHeight","3"), | |
("orient","auto")] [ | |
XMLElem "path" [("d", "M 0 0 L 10 5 L 0 10 z")] [] | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment