[commit: base] master: Remove uses of RecordWildCards in GHC.Event.TimerManager (1f81187)

Simon Marlow marlowsd at gmail.com
Wed Jul 3 10:08:35 CEST 2013


On 08/06/13 19:14, Ian Lynagh wrote:
> commit 1f81187e63dcd4f160cfd1ce62efc4b1d26603dc
> Author: Ian Lynagh <ian at well-typed.com>
> Date:   Sat Jun 8 18:54:23 2013 +0100
>
>      Remove uses of RecordWildCards in GHC.Event.TimerManager

curious: why?

> @@ -174,10 +173,10 @@ finished :: TimerManager -> IO Bool
>   finished mgr = (== Finished) `liftM` readIORef (emState mgr)
>
>   cleanup :: TimerManager -> IO ()
> -cleanup TimerManager{..} = do
> -  writeIORef emState Finished
> -  I.delete emBackend
> -  closeControl emControl
> +cleanup mgr = do
> +  writeIORef (emState mgr) Finished
> +  I.delete (emBackend mgr)
> +  closeControl (emControl mgr)

Note that in general this transformation might lead to worse code if the 
field selectors aren't used strictly. (I don't think it's the case here, 
but I didn't check the rest of the diff.)

Cheers,
	Simon




More information about the ghc-devs mailing list