Don Stewart | 1 May 2008 01:14
Picon
Picon
Favicon
Gravatar

patch applied (packages/base): Reexport (>>>) and (<<<) from Control.Arrow. Preserves API compatibility

Wed Apr 30 16:10:55 PDT 2008  Don Stewart <dons <at> galois.com>
  * Reexport (>>>) and (<<<) from Control.Arrow. Preserves API compatibility

    M ./Control/Arrow.hs -1 +3

View patch online:
http://darcs.haskell.org/packages/base/_darcs/patches/20080430231055-cba2c-fe12d31c0408e187899302846ee45e2189d9b14e.gz
Don Stewart | 2 May 2008 01:09
Picon
Picon
Favicon
Gravatar

patch applied (packages/base): Inline Data.Bits.rotate <at> Int, enables rotate to be constant folded

Thu May  1 16:01:52 PDT 2008  Don Stewart <dons <at> galois.com>
  * Inline Data.Bits.rotate <at> Int, enables rotate to be constant folded

  All other Bits instances seem to inline well enough on their own
  to enable constant folding, e.g.

      sumU . mapU (`shift` 3) . replicateU 10000000 $ (7 :: Int)

  goes to:

      Main.$wfold =
        \ (ww_sOb :: Int#) (ww1_sOf :: Int#) ->
          case ww1_sOf of wild_XM {
            __DEFAULT -> Main.$wfold (+# ww_sOb 56) (+# wild_XM 1);
            10000000 -> ww_sOb
          }

  With this patch, rotate gets inlined and folded too,

      sumU . mapU (`rotate` 3) . replicateU 10000000 $ (7 :: Int)

  to:

    Main.$wfold =
      \ (ww_sO7 :: Int#) (ww1_sOb :: Int#) ->
        case ww1_sOb of wild_XM {
          __DEFAULT -> Main.$wfold (+# ww_sO7 56) (+# wild_XM 1);
          10000000 -> ww_sO7

  Whereas it was left as a call to $wrotate before.
(Continue reading)

Simon Peyton Jones | 2 May 2008 09:42
Picon
Favicon
Gravatar

patch applied (packages/base): Add comments about why rotate has an INLINE

Fri May  2 00:41:37 PDT 2008  simonpj <at> microsoft.com
  * Add comments about why rotate has an INLINE

    M ./Data/Bits.hs -2 +28

View patch online:
http://darcs.haskell.org/packages/base/_darcs/patches/20080502074137-1287e-d488188a94f569b74e0cce2cf4fdb4933589dc11.gz
Simon Peyton-Jones | 2 May 2008 09:47
Picon
Favicon
Gravatar

RE: patch applied (packages/base): Inline Data.Bits.rotate <at> Int, enables rotate to be constant folded

Great stuff Don,

I've learned from experience that in 2 yrs time I will have forgotten why that INLINE is there, and may remove
it.  (Probably not in this particular case, but something similar.)  You may think that the info is in the
commit message, but in practice I just don't do a darcs annotate to see which patches modified the line, and
look at the commit log.

I think it's better to invest effort in putting documentation in the source code.  Rather than clutter up the
(Bits Int) instance, nowadays I add
        -- See Note [Constant folding for rotate]
and put a block comment, headed by that same string, lower down in the file.

I have found that this is a robust and effective way of documenting things.  Does that make sense?

I've pushed a patch doing this to Data.Bits.

Maybe I should update the programming conventions wiki!

Simon

| -----Original Message-----
| From: cvs-libraries-bounces <at> haskell.org [mailto:cvs-libraries-bounces <at> haskell.org] On Behalf
Of Don
| Stewart
| Sent: 02 May 2008 00:10
| To: cvs-libraries <at> haskell.org
| Subject: patch applied (packages/base): Inline Data.Bits.rotate <at> Int, enables rotate to be constant
| folded
|
| Thu May  1 16:01:52 PDT 2008  Don Stewart <dons <at> galois.com>
(Continue reading)

Don Stewart | 2 May 2008 18:23
Favicon
Gravatar

Re: patch applied (packages/base): Inline Data.Bits.rotate <at> Int, enables rotate to be constant folded

simonpj:
> Great stuff Don,
> 
> I've learned from experience that in 2 yrs time I will have forgotten
> why that INLINE is there, and may remove it.  (Probably not in this
> particular case, but something similar.)  You may think that the info
> is in the commit message, but in practice I just don't do a darcs
> annotate to see which patches modified the line, and look at the
> commit log.
> 
> I think it's better to invest effort in putting documentation in the
> source code.  Rather than clutter up the (Bits Int) instance, nowadays
> I add -- See Note [Constant folding for rotate] and put a block
> comment, headed by that same string, lower down in the file.

I like this idea. 

> 
> I have found that this is a robust and effective way of documenting
> things.  Does that make sense?
> 
> I've pushed a patch doing this to Data.Bits.
> 
> Maybe I should update the programming conventions wiki!

Yep, that might be a good idea. Something about providing good text,
with reproducible examples, and then adding that text as a footnote in
the source.
Simon Peyton-Jones | 2 May 2008 21:18
Picon
Favicon
Gravatar

RE: patch applied (packages/base): Inline Data.Bits.rotate <at> Int, enables rotate to be constant folded

| > Maybe I should update the programming conventions wiki!
|
| Yep, that might be a good idea. Something about providing good text,
| with reproducible examples, and then adding that text as a footnote in
| the source.

OK: here's a draft to improve.

http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle

Simon
Don Stewart | 2 May 2008 22:34
Favicon
Gravatar

Re: patch applied (packages/base): Inline Data.Bits.rotate <at> Int, enables rotate to be constant folded

simonpj:
> | > Maybe I should update the programming conventions wiki!
> |
> | Yep, that might be a good idea. Something about providing good text,
> | with reproducible examples, and then adding that text as a footnote in
> | the source.
> 
> OK: here's a draft to improve.
> 
> http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle
> 

Great, I like this idea for these particularly subtle/fragile issues,
that we may need to revisit 5-10 years down the track.

-- Don
Ian Lynagh | 11 May 2008 13:17
Picon
Gravatar

patch applied (packages/Cabal): Warn if a build-type is not specified. We want all packages to use this now.

Thu Jan 10 18:39:17 PST 2008  Duncan Coutts <duncan <at> haskell.org>
  * Warn if a build-type is not specified. We want all packages to use this now.

    M ./Distribution/PackageDescription.hs -5 +8
    M ./Distribution/Simple/SetupWrapper.hs -1 +2

View patch online:
http://darcs.haskell.org/packages/Cabal/_darcs/patches/20080111023917-adfee-b3dea2f6152edef2598e6cba2634d2baee565457.gz
Ian Lynagh | 11 May 2008 13:17
Picon
Gravatar

patch applied (packages/Cabal): Un-deprecate configCompilerAux

Thu Jan 10 09:51:48 PST 2008  Duncan Coutts <duncan <at> haskell.org>
  * Un-deprecate configCompilerAux
  but make it do something sensible with the ProgramConfiguration

    M ./Distribution/Simple/Configure.hs -3 +3

View patch online:
http://darcs.haskell.org/packages/Cabal/_darcs/patches/20080110175148-adfee-a5cf43f3ec627f7ef18b276acdc1654d908e8427.gz
Ian Lynagh | 11 May 2008 13:17
Picon
Gravatar

patch applied (packages/Cabal): Export the Flag constructors

Thu Jan 10 09:51:23 PST 2008  Duncan Coutts <duncan <at> haskell.org>
  * Export the Flag constructors

    M ./Distribution/Simple/Setup.hs -1 +1

View patch online:
http://darcs.haskell.org/packages/Cabal/_darcs/patches/20080110175123-adfee-9db568c6e24c874f3e57e3245851e8ff04e88bfd.gz

Gmane