@Daniel Fischer
Thanks for the offer, it's very kind of you, but I'm afraid I'll just need to try to understand monads for the hundredth time :/

@Brent Yorgey
Ah, thank you! But that would be the unsafe way, right? I think I should try to do it the "right" way, but I'm sure this'll come in handy when I get lost.


On 14 January 2011 20:00, Brent Yorgey <byorgey@seas.upenn.edu> wrote:
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

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners