From isaacdupree at charter.net Thu Mar 8 05:45:17 2007 From: isaacdupree at charter.net (Isaac Dupree) Date: Thu Mar 8 05:37:20 2007 Subject: [jhc] misleading comment Message-ID: <45EFE93D.4020207@charter.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In jhc lib/base/Jhc/Monad.hs there is {- INLINE return, fail, (>>=), (>>) -} before class Monad. This looks like a pragma but doesn't have the # marks. Is it even possible to inline methods for a whole class (or is it meant for the instances defined in the file?), and if so, is that place or on lines inside the class's "where" clause the right place? Isaac -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF7+k8HgcxvIWYTTURAjeUAJ0RW7KNIPScshTXUf4r8j1JAzZXJQCgosn/ L8yK308b+uVu30kkt8gAKiw= =QWTk -----END PGP SIGNATURE----- From john at repetae.net Thu Mar 8 13:05:19 2007 From: john at repetae.net (John Meacham) Date: Thu Mar 8 12:58:23 2007 Subject: [jhc] misleading comment In-Reply-To: <45EFE93D.4020207@charter.net> References: <45EFE93D.4020207@charter.net> Message-ID: <20070308180519.GA4626@momenergy.repetae.net> On Thu, Mar 08, 2007 at 05:45:17AM -0500, Isaac Dupree wrote: > In jhc lib/base/Jhc/Monad.hs > there is > {- INLINE return, fail, (>>=), (>>) -} > before class Monad. > This looks like a pragma but doesn't have the # marks. > Is it even possible to inline methods for a whole class (or is it meant > for the instances defined in the file?), and if so, is that place or on > lines inside the class's "where" clause the right place? At some point I was experimenting with the idea of being able to inline class methods and it was possible at some point. in practice it turned out to be a hassle and didn't buy much and that comment is a remenant from that time when I was turning it on and off. Once a class method is specialized though, it is beneficial to inline and that happens pretty much automatically. Currently you can't specify INLINE attributes for instances directly, but the aggressive inlining does it anyway as they most often turn out to be small functions or primitives. it would be a fairly straightforward fix. in the front end you would just need to notice when an INLINE is applied to a class instance method and translate it to an INLINE on the appropriate Instance@.method.type instance name via FrontEnd.Class.instanceName. John -- John Meacham - ?repetae.net?john? From naur at post11.tele.dk Fri Mar 16 20:13:52 2007 From: naur at post11.tele.dk (Thorkil Naur) Date: Fri Mar 16 20:14:59 2007 Subject: [jhc] Please help building jhc Message-ID: <200703170113.56149.naur@post11.tele.dk> Hello, Attempting to build jhc (the make install), I get: [ 8 of 166] Compiling Util.ArbitraryInstances ( Util/ArbitraryInstances.hs, Util/ArbitraryInstances.o ) Util/ArbitraryInstances.hs:7:0: Duplicate instance declarations: instance [overlap ok] (Arbitrary a) => Arbitrary (Maybe a) -- Defined at Util/ArbitraryInstances.hs:7:0 instance (Arbitrary a) => Arbitrary (Maybe a) -- Defined in Test.QuickCheck Util/ArbitraryInstances.hs:14:0: Duplicate instance declarations: instance [overlap ok] (Arbitrary a, Arbitrary b) => Arbitrary (Either a b) -- Defined at Util/ArbitraryInstances.hs:14:0 instance (Arbitrary a, Arbitrary b) => Arbitrary (Either a b) -- Defined in Test.QuickCheck make: *** [jhc] Error 1 tn@linux:~> This happens on a PPC Mac OS X 10.4. GHC is ghc 6.6 branch from February 21st 2007. Help to proceed from here would be most appreciated. Thanks and the best regards Thorkil