It works! Thank you!

I didn't know Haskell has such a great community.

Thanks again,
Kamil Stachowski


On 14 January 2011 23:40, Daniel Fischer <daniel.is.fischer@googlemail.com> wrote:
On Friday 14 January 2011 21:45:49, Kamil Stachowski wrote:
> It is funny, indeed :)
>
> In fact, I am after all going to get unsafe because what Daniel Fischer
> wrote above worked perfectly until I wanted to add annotations to ftConf
> (the "&= summary" bit in http://community.haskell.org/~ndm/cmdargs/).
> The only way I can go around the errors I get is precisely unsafe, so
> ah, you only live once ;)

Well, you could try

setTime :: FuzzyTimeConf -> IO FuzzyTimeConf
setTime ftc = do
 now <- getClockTime
 return $ ftc{ time = convert now }

-- put annotations here
defaultFuzzyTimeConf = FuzzyTimeConf { ... }

main = do
 realFTConf <- setTime defaultTimeConf
 print =<< cmdArgs realFTConf

I haven't looked at cmdargs, so I've no idea whether that'll work, but it
may be worth a try.