comparison 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
comparison
equal deleted inserted replaced
20:dd5b333a7960 21:7275f59cab61
32 * bear in order to count as a match. *) 32 * bear in order to count as a match. *)
33 33
34 val tagAO : attrs ::: {Unit} -> folder attrs -> string -> $(mapU string attrs) 34 val tagAO : attrs ::: {Unit} -> folder attrs -> string -> $(mapU string attrs)
35 -> pattern (tagInternal attrs) $(mapU (option string) attrs) 35 -> pattern (tagInternal attrs) $(mapU (option string) attrs)
36 (* A version of [tagA] that makes each attribute optional *) 36 (* A version of [tagA] that makes each attribute optional *)
37
38 val tagAOR : optional ::: {Unit} -> required ::: {Unit} -> [optional ~ required]
39 => folder optional -> folder required -> string
40 -> $(mapU string required) -> $(mapU string optional)
41 -> pattern (tagInternal (optional ++ required))
42 $(mapU string required ++ mapU (option string) optional)
43 (* A version of [tagAO] that does a check for mere presence of other attributes *)
37 44
38 val tagC : string -> pattern (tagInternal []) string 45 val tagC : string -> pattern (tagInternal []) string
39 (* A version of [tag] that only matches tags with nonempty CDATA and returns 46 (* A version of [tag] that only matches tags with nonempty CDATA and returns
40 * only that text *) 47 * only that text *)
41 48