#!/usr/bin/env runhaskell

Copyright (c) 2006 Don Stewart - http://www.cse.unsw.edu.au/~dons
GPL version 2 or later (see http://www.gnu.org/copyleft/gpl.html)

Make a news entry out of a triple of lines, the item, the author and the
link

> import Char
>
> main = interact (unlines . draw . lines)
>
> draw []       = []
> draw [x,y,z]  = 
>    ["    <li>"
>    ,"    <p><em>"++x'++"</em>. " ++dropSpace y
>    ,"    [http://www.cse.unsw.edu.au/~dons/"++dropSpace z++" announced]"
>    ,"    the "++x'
>    ,"    </p>"
>    ,"    </li>"
>    ]
>    where -- x' = (dropSpace . tail . dropWhile (/=':')) x
>          x' = dropSpace x
> draw x        = x

>
> dropSpace :: [Char] -> [Char]
> dropSpace = let f = reverse . dropWhile isSpace in f . f
>
