{-------------------------------------------------------------- - - 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 in doc('/home/fegaras/data/dblp.xml')//inproceedings at $i " ++" where $x/author = 'Leonidas Fegaras' " ++" orderby $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)