Mercurial > feed
comparison 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 |
comparison
equal
deleted
inserted
replaced
2:2ec84d349838 | 3:ea0ca570c121 |
---|---|
1 fun main () = | 1 fun main () = |
2 Feed.app (Feed.children | 2 Feed.app (Feed.children |
3 (Feed.tag "item" {1 = "rdf:about"}) | 3 (Feed.tagA "item" {1 = "rdf:about"}) |
4 (Feed.tag "title" {}, Feed.tag "content:encoded" {})) | 4 (Feed.tagC "title", Feed.tagC "content:encoded")) |
5 (fn ({Attrs = {1 = about}, ...}, | 5 (fn (item, props) => |
6 ({Cdata = title, ...}, {Cdata = content, ...})) => | 6 debug ("URL: " ^ item.1); |
7 debug ("URL: " ^ about); | 7 debug ("Title: " ^ props.1); |
8 (case title of | 8 debug ("Content: " ^ props.2)) |
9 None => return () | |
10 | Some title => debug ("Title: " ^ title)); | |
11 case content of | |
12 None => return () | |
13 | Some content => debug ("Content: " ^ content)) | |
14 "http://feeds.feedburner.com/marginalrevolution/hCQh"; | 9 "http://feeds.feedburner.com/marginalrevolution/hCQh"; |
15 return <xml> | 10 return <xml> |
16 See stdout. | 11 See stdout. |
17 </xml> | 12 </xml> |