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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Simon Marlow-7
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



Reply | Threaded
Open this post in threaded view
|

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

Ian Lynagh-2
On Wed, Jul 03, 2013 at 09:08:35AM +0100, Simon Marlow wrote:
> 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?

I wanted to be able to understand the code. It's easier if 'foo' doesn't
sometimes have type 'b' rather than 'a -> b'.


Thanks
Ian