[Haskell-beginners] IO String inside a CmdArgs data

Brent Yorgey byorgey at seas.upenn.edu
Fri Jan 14 20:00:51 CET 2011


On Fri, Jan 14, 2011 at 07:41:07PM +0100, Daniel Fischer wrote:
> 
> b) if you absolutely have to have ftConf as a top-level name and it is safe 
> here:
> 
> import System.IO.Unsafe (unsafePerformIO)
> 
> {-# NOINLINE ftConf #-}
> ftConf :: FuzzyTimeConf
> ftConf = unsafePerformIO $ do
>   now <- getClockTime
>   return $ FuzzyTimeConf { time = convert now }

There's already a Hackage package to accomplish this:

  http://hackage.haskell.org/package/acme-now

=)

-Brent



More information about the Beginners mailing list