[Haskell-beginners] IO String inside a CmdArgs data

Kamil Stachowski kamil.stachowski at gmail.com
Sat Jan 15 09:43:31 CET 2011


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 at 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110115/34192b65/attachment.htm>


More information about the Beginners mailing list