{-------------------------------------------------------------- - - The main program of the XQuery processor - Programmer: Leonidas Fegaras (fegaras@cse.uta.edu) - Date: 03/19/2008 - ---------------------------------------------------------------} {-# OPTIONS_GHC -fth #-} module Main where import XQuery f(x,y) = $(xe "{$x,', ',$y}") main = do a <- $(xq ("{ " ++" for $x at $i in doc('/home/fegaras/data/dblp.xml')//inproceedings " ++" where $x/author = 'Leonidas Fegaras' " ++" order by $x/year descending " ++" return { $i, ') ', $x/booktitle/text(), " ++" ': ', $x/title/text() " ++" } " ++" } ")) putStrLn (show a) b <- $(xq "f($a/paper[10],$a/paper[8])") putStrLn (show b)