It works! Thank you!
On Friday 14 January 2011 21:45:49, Kamil Stachowski wrote:Well, you could try
> 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 ;)
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.