compiler change
Christian Maeder
maeder at tzi.de
Fri Sep 22 05:07:59 EDT 2006
Simon Peyton-Jones schrieb:
> Aha! You are the second real customer to discover a change I made to
"customer" sounds as if I will have to pay next time.
> GHC 6.6, namely that pattern bindings are not generalised. It's a
> documented change (see "Monomorphic pattern bindings" in the 6.6 user
> manual), but it means that 6.6 is not, by default, exactly Haskell 98.
> To recover the previous behaviour use -fno-mono-pat-binds.
thanks for pointing this out!
> You can solve your problem in three ways
> * -fno-mono-pat-binds
> * use the fst/snd thing as you suggest
> * put the polymorphic function in the tuple as Bulat suggested (this
> makes use of GHC's new ability to impredicative polymorphism.
Last question, is using "fst/snd" really a problem as I suspected by
using the constant twice? (I actually didn't explicitly inline the
constant by two calls of unsafePerfromIO.)
Thanks again, Christian
> | -----Original Message-----
> | mkSimpleFallOut :: (ObjectID,IO a -> IO (Either String a))
> | mkSimpleFallOut = unsafePerformIO newFallOut
> | {-# NOINLINE mkSimpleFallOut #-}
> |
> | newFallOut :: IO (ObjectID, IO a -> IO (Either String a))
> | simpleFallOutId = fst mkSimpleFallOut
> | addSimpleFallOut = snd mkSimpleFallOut
> |
> | However, in this case I have inlined mkSimpleFallOut manually! Does
> this
> | matter? If so, how could I rewrite the above code?
More information about the Glasgow-haskell-users
mailing list