Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
On Dec 10, 2007, at 3:21 PM, Carsten Keßler wrote: Basically, I just wanted to get this thing running without too much hassle... Does anyone have an idea why the GHC distribution available via MacPorts does not work at the moment? Hi Carsten, The ghc distribution on MacPorts doesn't support 6.8.1 yet because I haven't finished porting it. The whole 6.8.1 release is sort of a mess. Our old bootstrap compiler on ppc (version 6.4) seems not to be able to build 6.8.1, contrary to expectations. I can get 6.6.1 to build 6.8.1, so I may just have to update the bootstrap compiler. (Updating the bootstrap compiler is a fair amount of work, mostly to check that no unnecessary dependencies get included. This is essential so that the process just works for most people.) I had asked on this list several days ago if anyone knew what versions of ghc were capable of building 6.8.1 and received no answer to this question. AFAIK, only 6.6.1 is capable of building 6.8.1, despite the the website's advertising that any version 6.0 should be sufficient. (The libraries for 6.8.1 seem to need 6.2 or later.) This will all take some time to sort out but it is being worked on. Best Wishes, Greg ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Hi, so does the GMP.framework installed via MacPorts do it, or not?! Apparently, it doesn't: -snip Macintosh-4:~ Carsten$ port installed The following ports are currently installed: ... gmp @4.2.2_0 (active) readline @5.2.007_0+darwin_9 (active) ... Macintosh-4:ghc-6.8.1 Carsten$ ./configure checking build system type... i386-apple-darwin9.1.0 checking host system type... i386-apple-darwin9.1.0 checking target system type... i386-apple-darwin9.1.0 Which we'll further canonicalise into: i386-apple-darwin checking for path to top of build tree... dyld: Library not loaded: GMP.framework/Versions/A/GMP Referenced from: /Users/Carsten/Desktop/ghc-6.8.1/utils/pwd/pwd Reason: image not found configure: error: cannot determine current directory -snap Is there another way to download / install GMP other than through MacPorts? Thanks, Carsten Manuel M T Chakravarty schrieb: Carsten Keßler: Basically, I just wanted to get this thing running without too much hassle... Does anyone have an idea why the GHC distribution available via MacPorts does not work at the moment? Install gmp from MacPorts. That will make the configure error go away. (The installed compiler will not use the MacPorts gmp; it is just needed during the installation.) I have no idea who maintains ghc in MacPorts, if anybody. Manuel Philip Weaver schrieb: configure: error: cannot determine current directory I had this error message, too. I looked in the configure script, and couldn't figure out what craziness it was doing to get the current directory. I changed it to just do 'pwd', but I didn't get much farther. I gave up and built from source :) On Dec 10, 2007 11:23 AM, Carsten Keßler [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I have re-installed GMP (again via MacPorts) - still the same error message. Maybe MacPorts puts in the wrong place on my system? Joel Reymont schrieb: You may want to install GMP.framework back then. The error is saying that pwd is trying to load the framework and is not finding it. On Dec 10, 2007, at 4:22 PM, Carsten Keßler wrote: No, I'm using the binaries from http://www.haskell.org/ghc/dist/6.8.1/chakravarty/ghc-6.8.1-i386-apple-darwin.tar.bz2 I have already removed GMP. I have uninstalled it via Macports, or might there be another version of it somewhere in my system? -- http://wagerlabs.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org mailto:Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users -- Carsten Keßler Institute for Geoinformatics, University of Münster http://www.carstenkessler.de ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users -- Carsten Keßler Institute for Geoinformatics, University of Münster http://www.carstenkessler.de ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Hi greg, Gregory Wright schrieb: The ghc distribution on MacPorts doesn't support 6.8.1 yet because I haven't finished porting it. I have already figured out that ghc via MacPorts only works if you have a working version of ghc on board, which I have not, so this is not an option for me right now. The whole 6.8.1 release is sort of a mess. Our old bootstrap compiler on ppc (version 6.4) seems not to be able to build 6.8.1, contrary to expectations. I can get 6.6.1 to build 6.8.1, so I may just have to update the bootstrap compiler. (Updating the bootstrap compiler is a fair amount of work, mostly to check that no unnecessary dependencies get included. This is essential so that the process just works for most people.) I had asked on this list several days ago if anyone knew what versions of ghc were capable of building 6.8.1 and received no answer to this question. AFAIK, only 6.6.1 is capable of building 6.8.1, despite the the website's advertising that any version 6.0 should be sufficient. (The libraries for 6.8.1 seem to need 6.2 or later.) Thanks for the detailed insight - however, I'm afraid I won't be able to help you in any way with these issues. Best, Carsten ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Carsten Keßler wrote: Hi, so does the GMP.framework installed via MacPorts do it, or not?! Apparently, it doesn't: -snip Macintosh-4:~ Carsten$ port installed The following ports are currently installed: ... gmp @4.2.2_0 (active) This does not look like a framework Is there another way to download / install GMP other than through MacPorts? http://www.haskell.org/ghc/dist/mac_frameworks/mac_e.htm Christian ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Which ghc versions can build ghc-6.8.1?
Gregory Wright wrote: Can 6.4 build 6.8.1? Or is a later version required? We test the GHC build with 6.2.2, and the latest released version (previously 6.6.1, now 6.8.1). It's not unlikely that bugs have crept in that make the build fail with 6.4.x; if you find any such bugs then please do let us have a fix. Cheers, Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: More spam problems on trac
Tim Chevalier wrote: It seems the new thing for spammers to do is to add spam text wrapped in the p style=display:none tag. For example, http://hackage.haskell.org/trac/ghc/wiki/WikiStart?action=diffversion=106 I don't know if anyone else has noticed this. Maybe it's time to require captchas for account creation or something? I have deleted the offending submissions. We have the spam filter Trac plugin installed, but apparently we don't have the BadContent wiki page from which the spam filter gets its regular expressions, so I just added one. Hopefully that should catch some of the spam. Cheers, Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
New woes regarding ghc-6.8.1 on FreeBSD-amd64
Some days ago I announced having success in porting ghc-6.8.1 to FreeBSD-7.0-amd64. As the compiler seemed to be able to compile itself, I was confident to make the binary package available to the public. Now I have found out that the port is rooten in a very weird way. From the files in testsuite (6.6.1) it has 4707 expected passes vs. 669 unexpected failures. Among the most unexpected of these is the failure of arith003 (conversions between Int and Integer near 64bit boundary). It seems there is still some 32/64-bit confusion left from the building process. Still worse is, that any attempt to use the partially usable compiler as bootstrap tool fails for some reasons. On a freshly configure 6.8.1 tree (with ./configure --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib ) the build process fails at libraries/base/Control/Concurrent.hs because gmp.h is not found by ghc-inplace I fixed this by copying /usr/local/include/gmp.h to ghc-6.8.1/includes. This is, of course, a risk of confusing the 32/64bit version of this library. Anyway, the resulting compiler in stage2/ghc-6.8.1 dumps core. Perhaps I can get better results, if I use the most conservative settings possible for stage1 build, but I have no idea what they are. The recommended porting process (via .hc files) fails, too. I am going to make a separate bug report about this. -- Dipl.-Math. Wilhelm Bernhard Kloke Institut fuer Arbeitsphysiologie an der Universitaet Dortmund Ardeystrasse 67, D-44139 Dortmund, Tel. 0231-1084-257 PGP: http://vestein.arb-phys.uni-dortmund.de/~wb/mypublic.key ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Hi Christian, Is there another way to download / install GMP other than through MacPorts? http://www.haskell.org/ghc/dist/mac_frameworks/mac_e.htm Thanks for the link, configure now works like a charm, but make install fails with the following error: - snip ... Installing: /Library/GHC/lib/ghc-6.8.1/lib/OpenGL-2.2.1.1 installPackage: Error: Could not find module: Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage with any suffix: [p_hi] make[1]: *** [install.library.OpenGL] Error 1 make: *** [install] Error 2 - snap Any ideas what that might mean? Carsten ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Installing on Leopard
I have some problems installing 6.8.1 on Mac OS X Leopard. First I installed readline using ports: $ sudo port install readline snip Then GHC $ ./configure --prefix=$HOME make install make -C rts install DOING_BIN_DIST=YES cc -E -undef -traditional -P -DINSTALLING \ -DIMPORT_DIR='/Users/tibell/lib/ghc-6.8.1/imports' \ -DLIB_DIR='/Users/tibell/lib/ghc-6.8.1' \ -DINCLUDE_DIR='/Users/tibell/lib/ghc-6.8.1/include' \ -DDATA_DIR='/Users/tibell/share/ghc-6.8.1' \ -DHTML_DIR='/Users/tibell/share/ghc-6.8.1/html/libraries/rts' \ -DHADDOCK_IFACE='/Users/tibell/share/ghc-6.8.1/html/libraries/rts/rts.haddock' \ -I../includes \ -x c -DGMP_INCLUDE_DIRS='' -DGMP_LIB_DIRS='' -I -Iinclude -DPACKAGE=rts -DVERSION= -DPKG_LIBDIR='/Users/tibell/lib/ghc-6.8.1' -DPKG_DATADIR='/Users/tibell/share/ghc-6.8.1' package.conf.in \ | grep -v '^#pragma GCC' \ | sed -e 's///g' -e 's/:[ ]*,/: /g' \ | /Users/tibell/Downloads/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin --global-conf /Users/tibell/lib/ghc-6.8.1/package.conf update - --force dyld: Library not loaded: /opt/local/lib/libgmp.3.dylib Referenced from: /Users/tibell/Downloads/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin Reason: image not found /bin/sh: line 1: 60782 Donecc -E -undef -traditional -P -DINSTALLING -DIMPORT_DIR='/Users/tibell/lib/ghc-6.8.1/imports' -DLIB_DIR='/Users/tibell/lib/ghc-6.8.1' -DINCLUDE_DIR='/Users/tibell/lib/ghc-6.8.1/include' -DDATA_DIR='/Users/tibell/share/ghc-6.8.1' -DHTML_DIR='/Users/tibell/share/ghc-6.8.1/html/libraries/rts' -DHADDOCK_IFACE='/Users/tibell/share/ghc-6.8.1/html/libraries/rts/rts.haddock' -I../includes -x c -DGMP_INCLUDE_DIRS='' -DGMP_LIB_DIRS='' -I -Iinclude -DPACKAGE=rts -DVERSION= -DPKG_LIBDIR='/Users/tibell/lib/ghc-6.8.1' -DPKG_DATADIR='/Users/tibell/share/ghc-6.8.1' package.conf.in 60783 | grep -v '^#pragma GCC' 60784 | sed -e 's///g' -e 's/:[ ]*,/: /g' 60786 Trace/BPT trap | /Users/tibell/Downloads/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin --global-conf /Users/tibell/lib/ghc-6.8.1/package.conf update - --force make[1]: *** [install] Error 133 make: *** [install] Error 2 --- I thought GHC shipped with its own GMP lib. -- Johan ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Carsten Keßler wrote: No, I'm using the binaries from http://www.haskell.org/ghc/dist/6.8.1/chakravarty/ghc-6.8.1-i386-apple-darwin.tar.bz2 Are you sure that you've downloaded chakravarty's binary-dist? This one does not require frameworks (and should not fail as below) checking for path to top of build tree... dyld: Library not loaded: GMP.framework/Versions/A/GMP Referenced from: /Users/Carsten/Desktop/ghc-6.8.1/utils/pwd/pwd Reason: image not found configure: error: cannot determine current directory This error message (and maybe your latest one about OpenGL) indicates more that you've got http://www.haskell.org/ghc/dist/6.8.1/scsibug/ghc-6.8.1-i386-apple-darwin.tar.bz2 Could you check this? Christian ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Carsten Keßler wrote: Installing: /Library/GHC/lib/ghc-6.8.1/lib/OpenGL-2.2.1.1 installPackage: Error: Could not find module: Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage with any suffix: [p_hi] I don't know what binary-distribution you've got, but the file libraries/OpenGL/dist/build/Graphics/Rendering/OpenGL/GL/PixelRectangles/PixelStorage.p_hi is included in both distributions from the download page: http://www.haskell.org/ghc/dist/6.8.1/chakravarty/ghc-6.8.1-i386-apple-darwin.tar.bz2 http://www.haskell.org/ghc/dist/6.8.1/scsibug/ghc-6.8.1-i386-apple-darwin.tar.bz2 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Installing on Leopard
Johan Tibell wrote: I have some problems installing 6.8.1 on Mac OS X Leopard. First I installed readline using ports: Again, I don't know what binary distribution you've got, but try to install gmp, too $ sudo port install readline snip --force dyld: Library not loaded: /opt/local/lib/libgmp.3.dylib Referenced from: /Users/tibell/Downloads/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin Reason: image not found This could be my binary: http://www.haskell.org/ghc/dist/6.8.1/maeder/ghc-6.8.1-i386-apple-darwin-tiger-optlibs.tar.bz2 Cheers Christian ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Installing on Leopard
Johan Tibell wrote: I thought GHC shipped with its own GMP lib. This is the case for: http://www.haskell.org/ghc/dist/6.8.1/chakravarty/ghc-6.8.1-i386-apple-darwin.tar.bz2 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
I'm now using the binaries from http://www.haskell.org/ghc/dist/6.8.1/chakravarty/ghc-6.8.1-i386-apple-darwin.tar.bz2 Configure still runs without problems, but now I get a new error during make install: /Users/Carsten/Desktop/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin --global-conf /Library/GHC/lib/ghc-6.8.1/package.conf update - --force dyld: Library not loaded: /opt/local/lib/libgmp.3.dylib Referenced from: /Users/Carsten/Desktop/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin Reason: image not found /bin/sh: line 1: 5312 Donecc -E -undef -traditional -P -DINSTALLING -DIMPORT_DIR='/Library/GHC/lib/ghc-6.8.1/imports' -DLIB_DIR='/Library/GHC/lib/ghc-6.8.1' -DINCLUDE_DIR='/Library/GHC/lib/ghc-6.8.1/include' -DDATA_DIR='/Library/GHC/share/ghc-6.8.1' -DHTML_DIR='/Library/GHC/share/ghc-6.8.1/html/libraries/rts' -DHADDOCK_IFACE='/Library/GHC/share/ghc-6.8.1/html/libraries/rts/rts.haddock' -I../includes -x c -DGMP_INCLUDE_DIRS='' -DGMP_LIB_DIRS='' -I -Iinclude -DPACKAGE=rts -DVERSION= -DPKG_LIBDIR='/Library/GHC/lib/ghc-6.8.1' -DPKG_DATADIR='/Library/GHC/share/ghc-6.8.1' package.conf.in 5313 | grep -v '^#pragma GCC' 5314 | sed -e 's///g' -e 's/:[ ]*,/: /g' 5315 Trace/BPT trap | /Users/Carsten/Desktop/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin --global-conf /Library/GHC/lib/ghc-6.8.1/package.conf update - --force make[1]: *** [install] Error 133 make: *** [install] Error 2 Is setting up GHC always that complicated? Cheers, Carsten ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Carsten Keßler wrote: I'm now using the binaries from http://www.haskell.org/ghc/dist/6.8.1/chakravarty/ghc-6.8.1-i386-apple-darwin.tar.bz2 Configure still runs without problems, but now I get a new error during make install: /Users/Carsten/Desktop/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin --global-conf /Library/GHC/lib/ghc-6.8.1/package.conf update - --force dyld: Library not loaded: /opt/local/lib/libgmp.3.dylib Referenced from: /Users/Carsten/Desktop/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin Reason: image not found Right, you need to install gmp from MacPorts, too, because chakravarty's binary still depends on it. (although gmp was integrated?) Christian otool -L utils/ghc-pkg/ghc-pkg.bin utils/ghc-pkg/ghc-pkg.bin: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /opt/local/lib/libgmp.3.dylib (compatibility version 8.0.0, current version 8.1.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) otool -L compiler/stage2/ghc-6.8.1 compiler/stage2/ghc-6.8.1: /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /opt/local/lib/libgmp.3.dylib (compatibility version 8.0.0, current version 8.1.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Carsten, This says that you must install the MacPorts GMP package. Do this, repeat the installation and let us know how it goes. On Dec 11, 2007, at 1:30 PM, Carsten Keßler wrote: /Users/Carsten/Desktop/ghc-6.8.1/utils/ghc-pkg/ghc-pkg.bin --global- conf /Library/GHC/lib/ghc-6.8.1/package.conf update - --force dyld: Library not loaded: /opt/local/lib/libgmp.3.dylib Referenced from: /Users/Carsten/Desktop/ghc-6.8.1/utils/ghc-pkg/ghc- pkg.bin Reason: image not found -- http://wagerlabs.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: Encoding Lists with Lengths by Type Family
I've typechecked this by hand, and indeed it looks to me as if it should work. (Admittedly, your inAssocL function is making an unsubstantiated claim (since you define it as 'undefined'), but that is still sound since any attempt to run the program will diverge. But it should tpyecheck.) Here is my calculation, for the Cons case of | revcat :: List a m - List a n - List a (Plus m n) | revcat Nil y = y | revcat (Cons a x) y = | subst incAssocL (revcat x (Cons a y)) y :: List a n x :: List a k, where m ~ Suc k Cons a y : List a Suc n revcat x (Cons a y) :: List a (Plus k (Suc n)) subst inAssocL (revcat x (Cons a y)) :: List a (Plus (Suc k) n) So to make the result type match up with the type of the RHS we need m ~ Suc k = List a (Plus m n) ~ List a (Plus (Suc k) n) which is of course the case. Manuel has made some recent changes -- I have not seen if they fix this. Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
class default method proposal
I'd just like to float an idea that's related to the Class Alias proposal[1] but is perhaps somewhat simpler. We all know that Functor should have been a superclass of Monad, and indeed we now know that Applicative should be too. Making such a change would break lots of things however so the change does not happen. However in this case the Monad operations can be used to implement the Functor and Applicative class methods. So it would be nice if we could get them for free if the author did not choose to write the Functor and Applicative instances. So my suggestion is that we let classes declare default implementations of methods from super-classes. class Functor m = Monad m where {- the ordinary bits -} fmap f m= m = return . f So if there already is a Functor instance for m then the default implementation of fmap is not used. Does this proposal have any unintended consequences? I'm not sure. Please discuss :-) Duncan [1] http://repetae.net/recent/out/classalias.html ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
On Tue, Dec 11, 2007 at 02:20:52PM +, Duncan Coutts wrote: I'd just like to float an idea that's related to the Class Alias proposal[1] but is perhaps somewhat simpler. We all know that Functor should have been a superclass of Monad, and indeed we now know that Applicative should be too. Making such a change would break lots of things however so the change does not happen. However in this case the Monad operations can be used to implement the Functor and Applicative class methods. So it would be nice if we could get them for free if the author did not choose to write the Functor and Applicative instances. So my suggestion is that we let classes declare default implementations of methods from super-classes. class Functor m = Monad m where {- the ordinary bits -} fmap f m= m = return . f So if there already is a Functor instance for m then the default implementation of fmap is not used. Does this proposal have any unintended consequences? I'm not sure. Please discuss :-) Duncan [1] http://repetae.net/recent/out/classalias.html This is almost exactly the http://haskell.org/haskellwiki/Class_system_extension_proposal; that page has some discussion of implementation issues. Stefan signature.asc Description: Digital signature ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
On Dec 11, 2007 9:20 AM, Duncan Coutts [EMAIL PROTECTED] wrote: So my suggestion is that we let classes declare default implementations of methods from super-classes. snip. Does this proposal have any unintended consequences? I'm not sure. Please discuss :-) It creates ambiguity if two classes declare defaults for a common superclass. My standard example involves Functor, Monad, and Comonad. Both Monad and Comonad could provide a default implementation for fmap. But let's say I have a type which is both a Monad and a Comonad: which default implementation gets used? I'm disappointed to see this objection isn't listed on the wiki. -- Dave Menendez [EMAIL PROTECTED] http://www.eyrie.org/~zednenem/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Carsten Keßler wrote: OK, now I get no GMP error any longer, instead, I got my good old OpenGL-error back... Installing: /Library/GHC/lib/ghc-6.8.1/lib/OpenGL-2.2.1.1 installPackage: Error: Could not find module: Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage with any suffix: [p_hi] make[1]: *** [install.library.OpenGL] Error 1 make: *** [install] Error 2 Did I miss more Libs that I need to install before running make install? Maybe GLUT and OpenGL frameworks are missing on your machine (but I would not expect the above failure during installation, only when calling: ghci -package OpenGL) Our {GLUT,OpenGL,OpenAL}.framework are under /System/Library/Frameworks HTH Christian ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
OK, now I get no GMP error any longer, instead, I got my good old OpenGL-error back... Installing: /Library/GHC/lib/ghc-6.8.1/lib/OpenGL-2.2.1.1 installPackage: Error: Could not find module: Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage with any suffix: [p_hi] make[1]: *** [install.library.OpenGL] Error 1 make: *** [install] Error 2 Did I miss more Libs that I need to install before running make install? Right, you need to install gmp from MacPorts, too, because chakravarty's binary still depends on it. (although gmp was integrated?) Christian otool -L utils/ghc-pkg/ghc-pkg.bin utils/ghc-pkg/ghc-pkg.bin: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /opt/local/lib/libgmp.3.dylib (compatibility version 8.0.0, current version 8.1.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) otool -L compiler/stage2/ghc-6.8.1 compiler/stage2/ghc-6.8.1: /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /opt/local/lib/libgmp.3.dylib (compatibility version 8.0.0, current version 8.1.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) -- Carsten Keßler Institute for Geoinformatics, University of Münster http://www.carstenkessler.de ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
On Tue, 2007-12-11 at 07:07 -0800, Stefan O'Rear wrote: This is almost exactly the http://haskell.org/haskellwiki/Class_system_extension_proposal; that page has some discussion of implementation issues. Oh yes, so it is. Did this proposal get discussed on any mailing list? I'd like to see what people thought. Was there any conclusion about feasibility? Duncan ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
Duncan Coutts wrote: On Tue, 2007-12-11 at 07:07 -0800, Stefan O'Rear wrote: This is almost exactly the http://haskell.org/haskellwiki/Class_system_extension_proposal; that page has some discussion of implementation issues. Oh yes, so it is. Did this proposal get discussed on any mailing list? I'd like to see what people thought. Was there any conclusion about feasibility? Ross proposed this on the libraries list in 2005: http://www.haskell.org//pipermail/libraries/2005-March/003494.html and I brought it up for Haskell': http://www.haskell.org//pipermail/haskell-prime/2006-April/001344.html see also this: http://www.haskell.org//pipermail/haskell-prime/2006-August/001582.html Unfortunately the Haskell' wiki doesn't have a good summary of the issues; it should. I'll add these links at least. Cheers, Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
On Tue, Dec 11, 2007 at 04:26:52PM +, Simon Marlow wrote: Duncan Coutts wrote: On Tue, 2007-12-11 at 07:07 -0800, Stefan O'Rear wrote: This is almost exactly the http://haskell.org/haskellwiki/Class_system_extension_proposal; that page has some discussion of implementation issues. Oh yes, so it is. Did this proposal get discussed on any mailing list? I'd like to see what people thought. Was there any conclusion about feasibility? Ross proposed this on the libraries list in 2005: http://www.haskell.org//pipermail/libraries/2005-March/003494.html and again in 2003: http://www.haskell.org/pipermail/haskell-cafe/2003-July/004654.html ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: [Haskell-cafe] class default method proposal
| If it really would work ok we should get it fully specified and | implemented so we can fix the most obvious class hierarchy problems in a | nice backwards compatible way. Things are only supposed to be candidates | for Haskell' if they're already implemented. Getting it fully specified is the first thing. Personally I am not keen about a) coupling it to explicit import/export (independently-desirable though such a change might be) b) having instance declarations silently spring into existence Concerning (b) here's a suggestion. As now, require that every instance requires an instance declaration. So, in the main example of http://haskell.org/haskellwiki/Class_system_extension_proposal, for a new data type T you'd write instance Monad T where return = ... (=) = ... instance Functor T instance Applicative T The instance declaration for (Functor T) works just as usual (no explicit method, so use the default method) except for one thing: how the default method is found. The change is this: Given instance C T where ..., for any method 'm' not defined by ...: for every class D of which C is a superclass where there is an instance for (D T) see if the instance gives a binding for 'm' If this search finds exactly one binding, use it, otherwise behave as now This formulation reduces the problem to a more manageable one: a search for the default method. I'm not sure what is supposed to happen if the instance is for something more complicated (T a, say, or multi-parameter type class) but I bet you could work it out. All these instances would need to be in the same module: - you can't define Functor T without Monad T, because you want to pick up the monad-specific default method - you can't define Monad T without Functor T, because the latter is a superclass of the former It still sounds a bit complicated. Simon ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
On Tue, 2007-12-11 at 16:38 +, Ross Paterson wrote: On Tue, Dec 11, 2007 at 04:26:52PM +, Simon Marlow wrote: Duncan Coutts wrote: On Tue, 2007-12-11 at 07:07 -0800, Stefan O'Rear wrote: This is almost exactly the http://haskell.org/haskellwiki/Class_system_extension_proposal; that page has some discussion of implementation issues. Oh yes, so it is. Did this proposal get discussed on any mailing list? I'd like to see what people thought. Was there any conclusion about feasibility? Ross proposed this on the libraries list in 2005: http://www.haskell.org//pipermail/libraries/2005-March/003494.html and again in 2003: http://www.haskell.org/pipermail/haskell-cafe/2003-July/004654.html Ross, you need to shout louder! :-) If it really would work ok we should get it fully specified and implemented so we can fix the most obvious class hierarchy problems in a nice backwards compatible way. Things are only supposed to be candidates for Haskell' if they're already implemented. So how about the objection that two sub classes could try and define conflicting defaults for a superclass method? David Menendez had the example of Monad and CoMonad defining Functor's fmap. Can that easily be rejected? I suppose it gives rise to duplicate instance declarations so it'd be an error in the same way that defining clashing instances in two different modules and importing both into a third module. Another error case would be: module A where data Foo module B where instance Functor Foo module C where instance Monad Foo module D import Bar import Baz Now we get slashing instances for Functor, since both Bar and Baz export Functor instances for Foo. Since the instance for Functor Foo was not visible in module C, so we get the default instance defined in C. So the one slightly surprising thing about this suggestion is that we get an instance defined or not depending on whether there is already an instance in scope. In the Functor, Applicative, Monad case I don't see that causing a problem in practise but is it worse more generally? Duncan ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Installing on Leopard
On Dec 11, 2007 1:56 PM, Christian Maeder [EMAIL PROTECTED] wrote: Johan Tibell wrote: I thought GHC shipped with its own GMP lib. This is the case for: http://www.haskell.org/ghc/dist/6.8.1/chakravarty/ghc-6.8.1-i386-apple-darwin.tar.bz2 This is the one I used and I didn't install GMP per the instructions but the error still seems related to GMP. What could be be the problem? Thanks! ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: class default method proposal
Jules Bean wrote: David Menendez wrote: Duncan Coutts wrote: So my suggestion is that we let classes declare default implementations of methods from super-classes. It creates ambiguity if two classes declare defaults for a common superclass. My standard example involves Functor, Monad, and Comonad. Both Monad and Comonad could provide a default implementation for fmap. But let's say I have a type which is both a Monad and a Comonad: which default implementation gets used? I'm disappointed to see this objection isn't listed on the wiki. Doesn't sound like a very big problem. That would just be a compile time error (More than one default for fmap possible for Foo, please reslve ambiguity). And how would you resolve that ambiguity? module Control.Functor.UsefulStuff (hylo) where hylo :: Functor f = (a - f a) - (f b - b) - a - b hylo f g = g . fmap (hylo f g) . f module BANG where import Foo (Foo) import Foo.Is.Monad import Foo.Is.Comonad import Control.Functor.UsefulStuff (hylo) bar :: Bar - Foo Bar baz :: Foo Baz - Baz bang = hylo bar baz The problem is that the ambiguity may arise by just importing different modules while not having access to the offending call to fmap . Also note that as much as I'd like explicit import/export of type class instances, the current implicit and global export is no accident, it's crucial for well-definedness. See also the second half of http://article.gmane.org/gmane.comp.lang.haskell.general/15471 In other words, the main problem of all those superclass/explicit import/export proposals is that there are no proofs of the fact that they only allow well-defined programs. The homework isn't done yet, discussing adoption is too early. Regards, apfelmus ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Installing on Leopard
You need to install gmp from MacPorts so that you have: /opt/local/lib/libgmp.3.dylib Thanks. That did it. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
Simon Peyton-Jones wrote: b) having instance declarations silently spring into existence Concerning (b) here's a suggestion. As now, require that every instance requires an instance declaration. So, in the main example of http://haskell.org/haskellwiki/Class_system_extension_proposal, for a new data type T you'd write instance Monad T where return = ... (=) = ... instance Functor T instance Applicative T Without the automatic search, this is already possible class Functor f where fmap :: (a - b) - f a - f b class Functor m = Monad m where return :: a - m a (=) :: m a - (a - m b) - m b -- aka liftM fmapDefault :: Monad m = (a - b) - m a - m b fmapDefault f m = m = (return . f) instance Monad [] where return x = [x] (=)= flip concatMap instance Functor [] where fmap = fmapDefault fmap is already written for you, the instance declaration is only boilerplate. I first saw this in Data.Traversable . Regards, apfelmus ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] class default method proposal
On Dec 11, 2007 1:29 PM, apfelmus [EMAIL PROTECTED] wrote: Without the automatic search, this is already possible class Functor f where fmap :: (a - b) - f a - f b class Functor m = Monad m where return :: a - m a (=) :: m a - (a - m b) - m b -- aka liftM fmapDefault :: Monad m = (a - b) - m a - m b fmapDefault f m = m = (return . f) instance Monad [] where return x = [x] (=)= flip concatMap instance Functor [] where fmap = fmapDefault fmap is already written for you, the instance declaration is only boilerplate. I first saw this in Data.Traversable . This is pretty much how I define Functor and Applicative instances for my monads. It is admittedly irritating to have to write out the boilerplate, but it doesn't seem irritating enough to require a language extension to eliminate. -- Dave Menendez [EMAIL PROTECTED] http://www.eyrie.org/~zednenem/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC 6.8.1 on Mac OS 10.5 Leopard (Intel) - Configure fails
Carsten Keßler: OK, now I get no GMP error any longer, instead, I got my good old OpenGL-error back... Installing: /Library/GHC/lib/ghc-6.8.1/lib/OpenGL-2.2.1.1 installPackage: Error: Could not find module: Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelStorage with any suffix: [p_hi] make[1]: *** [install.library.OpenGL] Error 1 make: *** [install] Error 2 Did I miss more Libs that I need to install before running make install? IIRC I have seen this error before. The reason was that the zip archive un-compressor that was used to unpack the tar.bz2 ball was not working correctly. Please us the tar xjf name of tarball to unpack the archive. Manuel Right, you need to install gmp from MacPorts, too, because chakravarty's binary still depends on it. (although gmp was integrated?) Christian otool -L utils/ghc-pkg/ghc-pkg.bin utils/ghc-pkg/ghc-pkg.bin: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /opt/local/lib/libgmp.3.dylib (compatibility version 8.0.0, current version 8.1.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) otool -L compiler/stage2/ghc-6.8.1 compiler/stage2/ghc-6.8.1: /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) /opt/local/lib/libgmp.3.dylib (compatibility version 8.0.0, current version 8.1.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) -- Carsten Keßler Institute for Geoinformatics, University of Münster http://www.carstenkessler.de ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users