[Haskell-cafe] How to write such a code elegantly ?
Henk-Jan van Tuyl
hjgtuyl at chello.nl
Mon Jan 10 12:25:47 CET 2011
On Mon, 10 Jan 2011 01:44:26 +0100, z_axis <z_axis at 163.com> wrote:
> picoSec :: IO Integer
> picoSec = do
> t <- ctPicosec `liftM` (getClockTime >>= toCalendarTime)
> return t
:
> How to write these pseudo-code elegantly ?
>
picoSec can be simplified to:
picoSec = ctPicosec `liftM` (getClockTime >>= toCalendarTime)
or:
picoSec = ctPicosec <$> (getClockTime >>= toCalendarTime)
Regards,
Henk-Jan van Tuyl
--
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
--
More information about the Haskell-Cafe
mailing list