install wxHaskell on osx 10.7 64bit

Hi list, I’m very Haskell newbie, and I’m trying to install wxHaskell in order to try out reactive-banana-wx. What I did so far: 1 ) Installed lastest Haskell platform 2) Installed wxWidgets from source, latest dev version from http://sourceforge.net/projects/wxwindows/files/2.9.3/wxWidgets-2.9.3.tar.bz... compiled with ../configure --with-osx_cocoa 3 ) darcs get http://darcsden.com/kowey/wxhaskell-osx64-dave built this one But then doing 'cabal install reactive-banana-wx’ will start installing wxcore-0.12.1.7 when the step 3) already installed wxcore-0.13.1 and that is the repository that should have the wxHaskell which works in osx lion. So is it possible to tell reactive-banana-wx to use wxcore-0.13.1 instead of wxcore-0.12.1.7 ? best, Miguel Negrão

On Sat, 07 Apr 2012 13:35:55 +0200, Miguel Negrao
So is it possible to tell reactive-banana-wx to use wxcore-0.13.1 instead of wxcore-0.12.1.7 ?
Try: cabal install reactive-banana-wx --constraint=wxcore==0.13.1 Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --

A 07/04/2012, às 16:32, Henk-Jan van Tuyl escreveu:
On Sat, 07 Apr 2012 13:35:55 +0200, Miguel Negrao
wrote: So is it possible to tell reactive-banana-wx to use wxcore-0.13.1 instead of wxcore-0.12.1.7 ?
Try: cabal install reactive-banana-wx --constraint=wxcore==0.13.1
Regards, Henk-Jan van Tuyl
-- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --
Then I get: cabal install reactive-banana-wx --constraint=wxcore==0.13.1 Resolving dependencies... cabal: cannot configure reactive-banana-wx-0.5.0.0. It requires wxcore ==0.12.1.7 For the dependency on wxcore ==0.12.1.7 there are these packages: wxcore-0.12.1.7. However none of them are available. wxcore-0.12.1.7 was excluded because of the top level dependency wxcore ==0.13.1 best, Miguel Negrão

Miguel Negrao wrote:
Then I get:
cabal install reactive-banana-wx --constraint=wxcore==0.13.1 Resolving dependencies... cabal: cannot configure reactive-banana-wx-0.5.0.0. It requires wxcore ==0.12.1.7 For the dependency on wxcore ==0.12.1.7 there are these packages: wxcore-0.12.1.7. However none of them are available. wxcore-0.12.1.7 was excluded because of the top level dependency wxcore ==0.13.1
I have hardcoded the wxcore==0.12.1.7 constraint in the reactive-banana-wx package because I didn't take the time to fix my installation problems with the newer wx package yet. You can override this by downloading the tarball from hackage and changing the dependency in reactive-banana-wx.cabal from build-depends: wxcore == 0.12.2.7 to the version you desire. Same for the wx == .. constraint. Then, simply type cabal install to install from the *.cabal file in your current directory. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com

Hi Heinrich, A 08/04/2012, às 08:53, Heinrich Apfelmus escreveu:
Miguel Negrao wrote:
Then I get: cabal install reactive-banana-wx --constraint=wxcore==0.13.1 Resolving dependencies... cabal: cannot configure reactive-banana-wx-0.5.0.0. It requires wxcore ==0.12.1.7 For the dependency on wxcore ==0.12.1.7 there are these packages: wxcore-0.12.1.7. However none of them are available. wxcore-0.12.1.7 was excluded because of the top level dependency wxcore ==0.13.1
I have hardcoded the wxcore==0.12.1.7 constraint in the reactive-banana-wx package because I didn't take the time to fix my installation problems with the newer wx package yet.
You can override this by downloading the tarball from hackage and changing the dependency in reactive-banana-wx.cabal from
build-depends: wxcore == 0.12.2.7
to the version you desire. Same for the wx == .. constraint. Then, simply type
cabal install
to install from the *.cabal file in your current directory.
I did: cabal unpack reactive-banana-wx-0.5.0.0 cd reactive-banana-wx-0.5.0.0/ edited reactive-banana-wx.cabal cabal install Resolving dependencies... [1 of 1] Compiling Main ( Setup.hs, dist/setup/Main.o ) Linking ./dist/setup/setup ... ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame Configuring reactive-banana-wx-0.5.0.0... Preprocessing library reactive-banana-wx-0.5.0.0... Preprocessing executables for reactive-banana-wx-0.5.0.0... Building reactive-banana-wx-0.5.0.0... [1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/build/Reactive/Banana/WX.o ) [1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/build/Reactive/Banana/WX.p_o ) Registering reactive-banana-wx-0.5.0.0... Creating application bundle directory dist/build/Asteroids.app Copying executable Asteroids into place setup: dist/build/Asteroids/Asteroids: does not exist cabal: Error: some packages failed to install: reactive-banana-wx-0.5.0.0 failed during the building phase. The exception was: ExitFailure 1 best, Miguel Negão

Miguel Negrao wrote:
I did:
cabal unpack reactive-banana-wx-0.5.0.0
cd reactive-banana-wx-0.5.0.0/
edited reactive-banana-wx.cabal
cabal install
Resolving dependencies... [1 of 1] Compiling Main ( Setup.hs, dist/setup/Main.o ) Linking ./dist/setup/setup ... ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame Configuring reactive-banana-wx-0.5.0.0... Preprocessing library reactive-banana-wx-0.5.0.0... Preprocessing executables for reactive-banana-wx-0.5.0.0... Building reactive-banana-wx-0.5.0.0... [1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/build/Reactive/Banana/WX.o ) [1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/build/Reactive/Banana/WX.p_o ) Registering reactive-banana-wx-0.5.0.0... Creating application bundle directory dist/build/Asteroids.app Copying executable Asteroids into place setup: dist/build/Asteroids/Asteroids: does not exist cabal: Error: some packages failed to install: reactive-banana-wx-0.5.0.0 failed during the building phase. The exception was: ExitFailure 1
Looks like it's an issue with the cabal-macosx package, which will be fixed soon. You probably also want to install the examples, so try cabal install -fbuildExamples instead. The buildExamples flag is also mentioned in the package description. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com

A 08/04/2012, às 10:44, Heinrich Apfelmus escreveu:
Miguel Negrao wrote:
I did: cabal unpack reactive-banana-wx-0.5.0.0 cd reactive-banana-wx-0.5.0.0/ edited reactive-banana-wx.cabal cabal install Resolving dependencies... [1 of 1] Compiling Main ( Setup.hs, dist/setup/Main.o ) Linking ./dist/setup/setup ... ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame Configuring reactive-banana-wx-0.5.0.0... Preprocessing library reactive-banana-wx-0.5.0.0... Preprocessing executables for reactive-banana-wx-0.5.0.0... Building reactive-banana-wx-0.5.0.0... [1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/build/Reactive/Banana/WX.o ) [1 of 1] Compiling Reactive.Banana.WX ( src/Reactive/Banana/WX.hs, dist/build/Reactive/Banana/WX.p_o ) Registering reactive-banana-wx-0.5.0.0... Creating application bundle directory dist/build/Asteroids.app Copying executable Asteroids into place setup: dist/build/Asteroids/Asteroids: does not exist cabal: Error: some packages failed to install: reactive-banana-wx-0.5.0.0 failed during the building phase. The exception was: ExitFailure 1
Looks like it's an issue with the cabal-macosx package, which will be fixed soon. You probably also want to install the examples, so try
cabal install -fbuildExamples
instead. The buildExamples flag is also mentioned in the package description.
Ok, so that means there’s nothing to be done for now, I just have to wait ? Some other small questions, not directly related: I’m using leksah to edit code. How do I: - Browse the source of reactive-banana from leksah ? I would like to check for instance how the Applicative of Behaviour is implemented. - Is it possible to check the type of statements from the gui ? - Is it possible to pull up the documentation of a function directly from the gui ? - Is it possible to to the definition of a function, including the ones in other packages (like the ones of reactive-banana) directly from the gui ? thanks ! Miguel Negrão

A 08/04/2012, às 10:44, Heinrich Apfelmus escreveu:
Looks like it's an issue with the cabal-macosx package, which will be fixed soon. You probably also want to install the examples, so try
cabal install -fbuildExamples
Not sure if I was suppose to try with that command, but If I do I get: miguelnegrao@Mac-Miguel:~/Development/Haskell/Libs/reactive-banana/reactive-banana-wx (master *)$ cabal install -fbuildExamples Resolving dependencies... Configuring reactive-banana-wx-0.6.0.0... Preprocessing library reactive-banana-wx-0.6.0.0... Preprocessing executables for reactive-banana-wx-0.6.0.0... Building reactive-banana-wx-0.6.0.0... Registering reactive-banana-wx-0.6.0.0... [2 of 2] Compiling Main ( src/Arithmetic.hs, dist/build/Arithmetic/Arithmetic-tmp/Main.o ) src/Arithmetic.hs:30:21: Not in scope: `behaviorText' src/Arithmetic.hs:31:21: Not in scope: `behaviorText' cabal: Error: some packages failed to install: reactive-banana-wx-0.6.0.0 failed during the building phase. The exception was: ExitFailure 1 Also wxHaskell seems to be properly installed since I can run the hello world app. best, Miguel Negrão

Ok, by deleting all the examples I managed to install reactive-banana-wx. The Couter.hs example runs fine. I’m now trying to do a example where the value of a slider is posted to text box, but I can’t get it to work. event0 is for events that don’t ouput anything, but slider has a value.... what should I do ? {----------------------------------------------------------------------------- A slider and a text box ------------------------------------------------------------------------------} {-# LANGUAGE ScopedTypeVariables #-} -- allows "forall t. NetworkDescription t" import Graphics.UI.WX hiding (Event) import Reactive.Banana import Reactive.Banana.WX {----------------------------------------------------------------------------- Main ------------------------------------------------------------------------------} main:: IO() main = start $ do f <- frame [text := "A slider"] sl <- hslider f False 0 100 [] output <- staticText f [] set f [layout := margin 10 $ column 25 [widget sl, widget output]] let networkDescription :: forall t. NetworkDescription t () networkDescription = do esl <- event0 sl command let b = stepper 0 esl -- this doesn’t work off course... sink output [text :== show <$> b] network <- compile networkDescription actuate network thanks Miguel Negrão

Miguel Negrao wrote:
A 08/04/2012, às 10:44, Heinrich Apfelmus escreveu:
Looks like it's an issue with the cabal-macosx package, which will be fixed soon. You probably also want to install the examples, so try
cabal install -fbuildExamples
Not sure if I was suppose to try with that command, but If I do I get:
miguelnegrao@Mac-Miguel:~/Development/Haskell/Libs/reactive-banana/reactive-banana-wx (master *)$ cabal install -fbuildExamples Resolving dependencies... Configuring reactive-banana-wx-0.6.0.0... Preprocessing library reactive-banana-wx-0.6.0.0... Preprocessing executables for reactive-banana-wx-0.6.0.0... Building reactive-banana-wx-0.6.0.0... Registering reactive-banana-wx-0.6.0.0... [2 of 2] Compiling Main ( src/Arithmetic.hs, dist/build/Arithmetic/Arithmetic-tmp/Main.o )
src/Arithmetic.hs:30:21: Not in scope: `behaviorText'
src/Arithmetic.hs:31:21: Not in scope: `behaviorText' cabal: Error: some packages failed to install: reactive-banana-wx-0.6.0.0 failed during the building phase. The exception was: ExitFailure 1
Errm, reactive-banana-0.6.0.0 is the current development branch which is definitely not going to compile. I meant the tarball from hackage, i.e. http://hackage.haskell.org/packages/archive/reactive-banana-wx/0.5.0.0/react...
I’m now trying to do a example where the value of a slider is posted to text box, but I can’t get it to work. event0 is for events that don’t ouput anything, but slider has a value.... what should I do ?
You can use fromPoll as the NetMonitor.hs examples demonstrates. Or you have to get an event from wx that indicates when the slider is moved, then you can use stepper or the fromChanges function. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com
participants (3)
-
Heinrich Apfelmus
-
Henk-Jan van Tuyl
-
Miguel Negrao