darcs patch: Generalize types of ManageHook functions, so they can ...

Wed Feb 23 19:30:21 EST 2011 Brandon S Allbery KF8NH

On Wed, Feb 23, 2011 at 8:15 PM, Brandon S Allbery KF8NH
Wed Feb 23 19:30:21 EST 2011 Brandon S Allbery KF8NH
* Generalize types of ManageHook functions, so they can be reused
Any thoughts from Core committers? -- gwern http://www.gwern.net

* On Monday, April 11 2011, Gwern Branwen wrote:
On Wed, Feb 23, 2011 at 8:15 PM, Brandon S Allbery KF8NH
wrote: Wed Feb 23 19:30:21 EST 2011 Brandon S Allbery KF8NH
* Generalize types of ManageHook functions, so they can be reused Any thoughts from Core committers?
One downside of more polymorphic types is that you get less specific type errors, since <+> will no longer force the result to be ManageHook. If all of a,b,c are somehow polymorphic (unlikely), defining the following but only using one in main will trigger the monomorphism restriction (mr):
myManageHook = a <+> b myManageHook2 = composeAll [a,b,c]
The mr is already much more likely to happen from unused layouts, since many layouts do not specify that they manage Window. But if there is a minor use for this patch (ex. a contrib patch or a config), it seems reasonable to push this. -- Adam

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 4/12/11 12:08 , Adam Vogt wrote:
* On Monday, April 11 2011, Gwern Branwen wrote:
On Wed, Feb 23, 2011 at 8:15 PM, Brandon S Allbery KF8NH
wrote: Wed Feb 23 19:30:21 EST 2011 Brandon S Allbery KF8NH
* Generalize types of ManageHook functions, so they can be reused Any thoughts from Core committers?
One downside of more polymorphic types is that you get less specific type errors, since <+> will no longer force the result to be ManageHook. If all
Er, <+> is *already* in the core in darcs xmonad, as is idHook. I generalized some of the others. - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery.b@gmail.com system administrator [openafs,heimdal,too many hats] kf8nh -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2k3JQACgkQIn7hlCsL25VFowCgqJUasCEvsGMfDi9IjXZd96dq a74AoJiT79sNgOP1s/WQ8QOfOiQWx8vg =Jzwd -----END PGP SIGNATURE-----

This 1-patch bundle was just applied to http://code.haskell.org/xmonad:
20110224003021 Brandon S Allbery KF8NH
participants (4)
-
Adam Vogt
-
Brandon S Allbery KF8NH
-
darcswatch@nomeata.de
-
Gwern Branwen