#!/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] = > ["
  • " > ,"

    "++x'++". " ++dropSpace y > ," [http://www.cse.unsw.edu.au/~dons/"++dropSpace z++" announced]" > ," the "++x' > ,"

    " > ,"
  • " > ] > where -- x' = (dropSpace . tail . dropWhile (/=':')) x > x' = dropSpace x > draw x = x > > dropSpace :: [Char] -> [Char] > dropSpace = let f = reverse . dropWhile isSpace in f . f >