
14 Jan
2009
14 Jan
'09
6:03 p.m.
Hello Jonathan, Thursday, January 15, 2009, 1:41:23 AM, you wrote:
reverseDouble = unlines . intro . map show . reverse . map (read :: String -> Double) . takeWhile (/= "end") . words
using arrows, this may be reversed: reverseDouble = words >>> takeWhile (/= "end") ...
I observe also in passing that the cast on read is somewhat inelegant; in a real application, the consumer of map read's output would specify its type sufficiently that the cast would be un-necessary.
in small scripts explicit read casts are rather common -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com