Mercurial > feed
diff src/ur/feed.urs @ 21:7275f59cab61
tagAOR and a Reddit example of using it
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 29 Sep 2012 10:30:00 -0400 |
parents | f641cfcd5153 |
children |
line wrap: on
line diff
--- a/src/ur/feed.urs Sat Jun 23 09:58:31 2012 -0400 +++ b/src/ur/feed.urs Sat Sep 29 10:30:00 2012 -0400 @@ -35,6 +35,13 @@ -> pattern (tagInternal attrs) $(mapU (option string) attrs) (* A version of [tagA] that makes each attribute optional *) +val tagAOR : optional ::: {Unit} -> required ::: {Unit} -> [optional ~ required] + => folder optional -> folder required -> string + -> $(mapU string required) -> $(mapU string optional) + -> pattern (tagInternal (optional ++ required)) + $(mapU string required ++ mapU (option string) optional) +(* A version of [tagAO] that does a check for mere presence of other attributes *) + val tagC : string -> pattern (tagInternal []) string (* A version of [tag] that only matches tags with nonempty CDATA and returns * only that text *)