Mercurial > feed
diff tests/mr.ur @ 3:ea0ca570c121
Shortcut tag combinators
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Tue, 11 Jan 2011 14:19:51 -0500 |
parents | 8de269c09617 |
children | a4e5d053daed |
line wrap: on
line diff
--- a/tests/mr.ur Tue Jan 11 14:05:34 2011 -0500 +++ b/tests/mr.ur Tue Jan 11 14:19:51 2011 -0500 @@ -1,16 +1,11 @@ fun main () = Feed.app (Feed.children - (Feed.tag "item" {1 = "rdf:about"}) - (Feed.tag "title" {}, Feed.tag "content:encoded" {})) - (fn ({Attrs = {1 = about}, ...}, - ({Cdata = title, ...}, {Cdata = content, ...})) => - debug ("URL: " ^ about); - (case title of - None => return () - | Some title => debug ("Title: " ^ title)); - case content of - None => return () - | Some content => debug ("Content: " ^ content)) + (Feed.tagA "item" {1 = "rdf:about"}) + (Feed.tagC "title", Feed.tagC "content:encoded")) + (fn (item, props) => + debug ("URL: " ^ item.1); + debug ("Title: " ^ props.1); + debug ("Content: " ^ props.2)) "http://feeds.feedburner.com/marginalrevolution/hCQh"; return <xml> See stdout.