[Haskell-cafe] Testing non-exported functions using ghci

2006-11-13 Thread John Ky
Hello,I have modules that don't export some functions. Is there a way I can access them from ghci without exporting them?Thanks-John
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Great language shootout: reloaded

2006-11-13 Thread tpledger
Donald Bruce Stewart wrote:
[...]
 While we're here we should fix:
   chameneos
 And anything else you want to take a
 look at.

 A community page has been set up to
 which you can submit improved entries:

http://www.haskell.org/haskellwiki/Great_language_shootout
[...]


Well, then!

I've put a new chameneos solution up on the wiki, and will
wait the recommended couple of days for Community Feedback.

- Tom
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Great language shootout: reloaded

2006-11-13 Thread Donald Bruce Stewart
tpledger:
 Donald Bruce Stewart wrote:
 [...]
  While we're here we should fix:
chameneos
  And anything else you want to take a
  look at.
 
  A community page has been set up to
  which you can submit improved entries:
 
 http://www.haskell.org/haskellwiki/Great_language_shootout
 [...]
 
 
 Well, then!
 
 I've put a new chameneos solution up on the wiki, and will
 wait the recommended couple of days for Community Feedback.

Great!

One issue is that the pragma is unnecessary (all the good flags are
set in the Makefile, so that saves a few gzipped bytes ;)

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Bulat Ziganshin
Hello Duncan,

Monday, November 13, 2006, 3:36:32 AM, you wrote:

 afaik, there are just two good enough libs - wxHaskell and GtkHs. can

in brief, i see the following main differences:

- wxHaskell is easier to understand and to use, Ght2Hs allows to use
Glade to develop lookfeel

- Gtk2Hs had better support, but now wxHaskell has more maintainers and
situation may change to opposite in a next few months

- wxHaskell provides more native lookfeel, while Gtk2Hs simplifies
porting of GUI application from Windows to Linux. Also Gtk2Hs needs Gtk
DLL to be installed, but this can be made a part of application
installation procedure, afaik?

- Gtk2Hs has better memory management

- differences between Gtk and wxWidgets that i will go to study


i also have more questions: first, how about tabbed pages control?
such controls are widely used to represent plenty of information in
limited screen space

second: ability and easiness to develop my own controls, and to
combine several customized controls together to make one
supercontrol (although i guess that last feature is important only
for RAD environments)

third: are there any appetizers demonstrating features of each
library and with source code available for studying? except for
memory.pdf which don't mention where full source can be downloaded

it will be interesting to see sources of more business-like
applications developed with both libs. if there are no ones, may be i
will develop basic file manager utility as such appetizer



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Testing non-exported functions using ghci

2006-11-13 Thread Joachim Breitner
Hi,

Am Montag, den 13.11.2006, 21:24 +1100 schrieb John Ky:
 I have modules that don't export some functions.  Is there a way I can
 access them from ghci without exporting them?

It seems that if there are .hi files around, ghci can’t reach the
non-exported functions, but if you delete this file, it works.

Greetings,
Joachim
-- 
Joachim Breitner
  e-Mail: [EMAIL PROTECTED]
  Homepage: http://www.joachim-breitner.de
  ICQ#: 74513189
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Duncan Coutts
On Mon, 2006-11-13 at 15:41 +0300, Bulat Ziganshin wrote:
 Hello Duncan,
 
 Monday, November 13, 2006, 3:36:32 AM, you wrote:
 
  afaik, there are just two good enough libs - wxHaskell and GtkHs. can
 
 in brief, i see the following main differences:
 
 - wxHaskell is easier to understand and to use, Ght2Hs allows to use
 Glade to develop lookfeel

Easier to understand is rather a matter of personal taste. Certainly Gtk
is a big library, providing lots of features. I should also note that
one of the main improvements in the upcoming Gtk2Hs release will be to
try to simplify the api and improve the reference documentation by
making greater use of atribute and signal abstractions rather than lots
of getter/setter functions.

 - Gtk2Hs had better support, but now wxHaskell has more maintainers and
 situation may change to opposite in a next few months

It'll be good to have more competition :-) hopefully both systems will
improve more rapidly.

 - wxHaskell provides more native lookfeel, while Gtk2Hs simplifies
 porting of GUI application from Windows to Linux. Also Gtk2Hs needs Gtk
 DLL to be installed, but this can be made a part of application
 installation procedure, afaik?

Both Gtk2Hs and wxHaskell need DLLs to be installed and in both cases it
can be made part of the install procedure. You just need to bung the
right set of dlls in the same directory as the .exe that you distribute.
It's exactly the same as with any other windows app that needs extra
dlls.

 - Gtk2Hs has better memory management
 
 - differences between Gtk and wxWidgets that i will go to study
 
 
 i also have more questions: first, how about tabbed pages control?
 such controls are widely used to represent plenty of information in
 limited screen space

Both have tab controls.

 second: ability and easiness to develop my own controls, and to
 combine several customized controls together to make one
 supercontrol (although i guess that last feature is important only
 for RAD environments)
 
 third: are there any appetizers demonstrating features of each
 library and with source code available for studying? except for
 memory.pdf which don't mention where full source can be downloaded

There are a bunch of demos included in the Gtk2Hs sources and there are
various apps written by other people available on the web.

For example:

http://www.cs.kent.ac.uk/projects/pivotal/downloads.html
http://haskell.galois.com/~paolo/nymphaea/

Apart from the memory pdf intro there a general intro presentation and a
glade tutorial:

http://haskell.org/gtk2hs/archives/2006/03/06/introductory-presentation/
http://eddy.writelinux.com/gtk2hs/GladeGtk2Hs.html

 it will be interesting to see sources of more business-like
 applications developed with both libs. if there are no ones, may be i
 will develop basic file manager utility as such appetizer

That would be great.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Neil Mitchell

Hi


- Gtk2Hs had better support, but now wxHaskell has more maintainers and
situation may change to opposite in a next few months


As long as Duncan is around, there will always be enough Gtk2Hs
support! Currently Gtk2Hs _has_ better support, the situation may
change or may not. Remember that Duncan is not the only Gtk2Hs person,
merely the most active :)


- wxHaskell provides more native lookfeel


Definately true. For GuiHaskell
(http://www-users.cs.york.ac.uk/~ndm/projects/guihaskell.php) I was
able to get it quite Windows looking with a bit of help from Duncan.
As a result of the attempt to make it more Windows like a few Gtk bugs
were filed, and it does appear that better Windows GUI styles are
something that is already in a Gtk release.


third: are there any appetizers demonstrating features of each
library and with source code available for studying? except for
memory.pdf which don't mention where full source can be downloaded


The full source code of GuiHaskell is available.

The one thing you should be aware of is that Windows + Threading +
Gtk2Hs + Gtk + GHC = Pain. I suspect the same equation holds for
wxHaskell as well. Ask Duncan for more information if this looks like
being a problem.

Thanks

Neil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] deepSeq vs rnf

2006-11-13 Thread Björn Bringert

Cale Gibbard wrote:

On 22/10/06, Chad Scherrer [EMAIL PROTECTED] wrote:

Hi,

I had posted this question a while back, but I think it was in the
middle of another discussion, and I never did get a reply. Do we
really need both Control.Parallel.Strategies.rnf and deepSeq? Should
we not always have

x `deepSeq` y == rnf x `seq` y
?

Maybe there's a distinction I'm missing, but it seems to me they're
basically the same.


I agree, they are the same. The Strategies library also gives much
more general operations for working with strictness and
parallelisation. That library seems to need more love, I think it's a
great idea, but it doesn't really get noticed all that much. The
Hierarchical libraries documentation for it is a little lacking -- it
doesn't even provide a reference or link to the paper, and many of the
combinators, as well as the general idea of how to use it are
undocumented from there. It also spuriously contains an Assoc
datatype, which if I recall correctly, was an example from the paper,
but doesn't really belong in the library as far as I can tell. It
would also be really nice to see the list of instances for the NFData
class expanded to include other datatypes in the libraries, possibly
also with compiler support for deriving, since it's mostly
boilerplate.


I wanted to use the Strategies library and didn't understand much of it, 
so I sat down and documented it. The darcs version, 
http://darcs.haskell.org/packages/base/Control/Parallel/Strategies.hs 
has my changes.


If noone objects, I could do some more clean-up, including:

- Add NFData instances for common data types, such as
  - Maybe
  - Either
  - Data.Map.Map
  - Data.Set.Set
  - Data.Tree.Tree
  - All Data.Int and Data.Word types

- Deprecate sSeq and sPar, as the code comments say that you should use
  demanding and sparking instead.

- Deprecate these defintions, which seem to be examples or
  Lolita-specific:
  - Assoc
  - fstPairFstList
  - force
  - sforce


If anyone has objections or further suggestions, let me know.

/Björn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[4]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Bulat Ziganshin
Hello Duncan,

Monday, November 13, 2006, 4:10:03 PM, you wrote:

on the download page only GHC 6.4.1 support mentioned. is 6.4.2 and
6.6 supported on windows? on linux? where i can read about forthcoming
gtk2hs version and when it will be released?

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[4]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Bulat Ziganshin
Hello Neil,

Monday, November 13, 2006, 4:43:59 PM, you wrote:

 The full source code of GuiHaskell is available.

i will at it too

 The one thing you should be aware of is that Windows + Threading +
 Gtk2Hs + Gtk + GHC = Pain.

why? are you tried to call Gtk2Hs from only one thread?

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Section Syntax Errors

2006-11-13 Thread Henning Thielemann

On Sat, 11 Nov 2006, David House wrote:

 On 11/11/06, Aditya Siram [EMAIL PROTECTED] wrote:
  subOne :: [Integer] - [Integer]
  subOne = map (- 1)
 
 The short answer is that this is interpreted as negative unity, rather
 than a section of binary minus. There are two common workarounds:
 
 subOne = map (subtract 1)
 subOne = map (+ (-1))
 
 There's a whole minefield of opinions on whether this is the right
 syntax or not. I'm sure you could google through the archives to
 research this a bit more.

E.g. this thread
  http://www.haskell.org/pipermail/haskell-cafe/2006-August/017403.html
continued here:
  http://www.haskell.org/pipermail/haskell-cafe/2006-September/017941.html
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[4]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Neil Mitchell

Hi Bulat,

http://haskell.org/~duncan/gtk2hs/gtk2hs-0.9.10.exe

That's the most recent Gtk2Hs for 6.4.2.


 The one thing you should be aware of is that Windows + Threading +
 Gtk2Hs + Gtk + GHC = Pain.

why? are you tried to call Gtk2Hs from only one thread?


I think so, yes. Or there are bizare -threaded restrictions. Only
Duncan (and perhaps Simon Marlow) understand this. I merely got bit by
it...

Thanks

Neil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[6]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Bulat Ziganshin
Hello Neil,

Monday, November 13, 2006, 5:06:02 PM, you wrote:

 http://haskell.org/~duncan/gtk2hs/gtk2hs-0.9.10.exe

 That's the most recent Gtk2Hs for 6.4.2.

the http://haskell.org/gtk2hs/download/ page says that gtk2hs is
available only for 6.4.1


  The one thing you should be aware of is that Windows + Threading +
  Gtk2Hs + Gtk + GHC = Pain.

 why? are you tried to call Gtk2Hs from only one thread?

 I think so, yes. Or there are bizare -threaded restrictions. Only
 Duncan (and perhaps Simon Marlow) understand this. I merely got bit by
 it...

it will be great to see comments about this. it's impossible to write
my program without using threaded RTS

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Ferenc Wagner
Bulat Ziganshin [EMAIL PROTECTED] writes:

 of remaining, Ubuntu has widest support here while SuSe is favourite
 of my friend. one thing that i like in suse is that it uses the same
 RPMs as RedHat and RPMs is widely used for packaging software
 available via internet. Is Ubuntu supports RPMs too?

Hi Bulat,

forget RPM's, real men use DEB's.  Ubuntu -- being a Debian derivative
-- does so, too.  Btw Debian unstable has got GHC 6.6, and isn't
unstable nowadays, except for the name.  Better call it Sid; the
freezing process has already begun.  If you are interested in a stable
system with GHC 6.6, go with Debian Sid until it transforms into Etch
(the next stable version).  Then you can forget hacking Linux for a
couple of years.  On the other hand, it will probably take some months
until release, which brings some risk in the game.
-- 
Regards,
Feri.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Max Vasin
Yes, but I wouldn't recommend installing rpms in debian-based system
(although, it can work perfectly). GHC 6.6 is in Debian unstable
(and should be in Ubuntu 6.10 or development branch). Ubuntu universe
repositiry is automatically updated from Debian repos thus being
one of the largest repos for Linux.

PS: I'm using Debian testing/unstable.

--
WBR,
Max Vasin

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: what GUI library should i select?

2006-11-13 Thread Max Vasin
On linux you should use your package manager (whenever possible), not binaries 
from the site (or compile it yourself).

--
WBR,
Max Vasin.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Mark T.B. Carroll
Max Vasin [EMAIL PROTECTED] writes:

 Yes, but I wouldn't recommend installing rpms in debian-based system
 (although, it can work perfectly). GHC 6.6 is in Debian unstable
 (and should be in Ubuntu 6.10 or development branch). Ubuntu universe
 repositiry is automatically updated from Debian repos thus being
 one of the largest repos for Linux.

 PS: I'm using Debian testing/unstable.

How up to date will Debian unstable's GHC be kept, though? It seems
pretty good at the moment, but there have been times when we've had to
install from source instead of via Debian earlier this year so that we
had GHC features and bugfixes in place - the Debian version has got
rather out of date at times with respect to stuff we needed.

-- Mark

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Alex Queiroz

Hallo,

On 11/13/06, Mark T.B. Carroll [EMAIL PROTECTED] wrote:


How up to date will Debian unstable's GHC be kept, though? It seems
pretty good at the moment, but there have been times when we've had to
install from source instead of via Debian earlier this year so that we
had GHC features and bugfixes in place - the Debian version has got
rather out of date at times with respect to stuff we needed.



No OpenGL neither Gtk2hs in Debian Sid yet. :-(

--
-alex
http://www.ventonegro.org/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Debugging

2006-11-13 Thread Valentin Gjorgjioski

On 13.11.2006 16:48 Pepe Iborra wrote:

Hi Valentin

Please, take a look at the Haskell Wiki page for debugging.

http://haskell.org/haskellwiki/Debugging

You will find that thanks to Neil Mitchell there is a Windows version 
of Hat available. Perhaps you can add your experiences with it if it 
works for you.


Oh silly me, I was looking that page, but I didn't notice this. Thanks a 
lot, pepe.

I'll try, and I'll post feedback here.


Valentin

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[6]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Sebastian Sylvan

On 11/13/06, Bulat Ziganshin [EMAIL PROTECTED] wrote:

Hello Neil,

Monday, November 13, 2006, 5:06:02 PM, you wrote:

 http://haskell.org/~duncan/gtk2hs/gtk2hs-0.9.10.exe

 That's the most recent Gtk2Hs for 6.4.2.

the http://haskell.org/gtk2hs/download/ page says that gtk2hs is
available only for 6.4.1


  The one thing you should be aware of is that Windows + Threading +
  Gtk2Hs + Gtk + GHC = Pain.

 why? are you tried to call Gtk2Hs from only one thread?

 I think so, yes. Or there are bizare -threaded restrictions. Only
 Duncan (and perhaps Simon Marlow) understand this. I merely got bit by
 it...

it will be great to see comments about this. it's impossible to write
my program without using threaded RTS


I'm not an expert, but I think the only solutions available depend on
some sort of polling.
E.g. you could start the GUI in a single bound thread, and then pass
in all GUI calls to a channel. Then you would attach an event handler
to idle event (or a timer) which checks to see if there are any items
in the channel, and if so runs them in the GUI thread.

The problem is that you can't actually run GUI actions from other
threads, you can only schedule them to be run by the GUI thread, and
you can't actually insert your block on the UI actions queue as
well as message queue in the GTK event loop. So you have to every now
and then do this yourself. This could end up in a situation where you
very often check this channel and it's empty, which uses unnecessary
resources, or it could end up in a situation where you don't check it
often enough and any UI actions caused by other threads get delayed.

I suspect that a more sophistated scheduler could be written which
helps with most of this (i.e. use a timer with some default value, if
there are many items in the channel then decrease the timout value, if
there are no items in the channel increase the timout value up to some
maximum).

/S
--
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell Debugging

2006-11-13 Thread Pepe Iborra
Can you manage to compile GHC under Windows? Compiling GHC under  
Windows is known to be a bit tricky and time consuming, certainly not  
for the novice user, although the steps are well detailed in the GHC  
developer documentation.


If so, I'd encourage you to play with the Ghci Debugger project. But  
beware, it is still in an experimental phase and there are some  
pending issues.


If you want to try it I have set up the repository to point to the  
last good known version I have around.  Just follow the  
instructions on how to get the patches in the wiki page.



Otherwise, I'd advise you to stick to Debug.Trace and friends.

Cheers
pepe

On 13/11/2006, at 17:29, Valentin Gjorgjioski wrote:


On 13.11.2006 16:54 Valentin Gjorgjioski wrote:

On 13.11.2006 16:48 Pepe Iborra wrote:

Hi Valentin

Please, take a look at the Haskell Wiki page for debugging.

http://haskell.org/haskellwiki/Debugging

You will find that thanks to Neil Mitchell there is a Windows  
version of Hat available. Perhaps you can add your experiences  
with it if it works for you.


Oh silly me, I was looking that page, but I didn't notice this.  
Thanks a lot, pepe.

I'll try, and I'll post feedback here.


I install it, I tried it, and it doesn't work for me.

./Hat/DML.hs:535:66:
  Ambiguous type variable `a' in the constraint:
`Integral a' arising from use of `*^' at ./Hat/DML.hs:535:66-69
  Probable fix: add a type signature that fixes these type variable(s)

And this is line 535
T.uapp2 p125v94v125v148 p125v147v125v147 p (+^) (*^)

After that, I have in my code used operator ^, and I deleted that  
operator. Program finally compiled, but now, hat-observe reports me  
an error... this program has encountered a problem


So, I will be really happy with something simple as Hugs.Observe if  
it works with floats. Some recommendation please?

Valentin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: best Linux for GHC?

2006-11-13 Thread Luis F. Araujo
Alex Queiroz wrote:
 Hallo,

 On 11/13/06, Mark T.B. Carroll [EMAIL PROTECTED] wrote:
 
 How up to date will Debian unstable's GHC be kept, though? It seems
 pretty good at the moment, but there have been times when we've had to
 install from source instead of via Debian earlier this year so that we
 had GHC features and bugfixes in place - the Debian version has got
 rather out of date at times with respect to stuff we needed.

   
 No OpenGL neither Gtk2hs in Debian Sid yet. :-(
 

I'd recommend Gentoo for using these kind of packages.

We even have darcs repository versions of Gtk2Hs in our gentoo haskell
overlay.

Regards,
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Testing non-exported functions using ghci

2006-11-13 Thread Henning Thielemann

On Mon, 13 Nov 2006, Joachim Breitner wrote:

 Am Montag, den 13.11.2006, 21:24 +1100 schrieb John Ky:
  I have modules that don't export some functions.  Is there a way I can
  access them from ghci without exporting them?
 
 It seems that if there are .hi files around, ghci can't reach the
 non-exported functions, but if you delete this file, it works.

or 'touch' the source module
 http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-compiled.html
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Tim Docker

 afaik, there are just two good enough libs - wxHaskell and GtkHs. can
 anyone point (or write) detailed comparison of their features?

One point in wxHaskell's favour is that it supports Mac OS X directly. At
present, to the best of my knowledge, you can only run GtkHs applications
on OS X using the X Windows server. Whilst this works, it's a _long_ way
from native look and feel.

If OS X support is significant to you, this may sway your decision.

Tim


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] best Linux for GHC?

2006-11-13 Thread Magnus Therning
On Mon, Nov 13, 2006 at 13:36:13 +0300, Bulat Ziganshin wrote:
Hello Ketil,

Monday, November 13, 2006, 10:45:59 AM, you wrote:

 My friend offered me 3 variants: SuSe, Fedora Core 5, free variant of
 RedHat (i can't remember its name, may be Ubuntu?)
 CentOS, perhaps?  It is usually good advice to choose whatever your 
 friends are using,

thanks to everyone who answered my question!

as you say, FC and CentOS are not ideal for me. Gentoo is too good for
me, it is for unix geeks while i just don't have resources to play one
more Game. i think that i will install it on my next box

of remaining, Ubuntu has widest support here while SuSe is favourite of
my friend. one thing that i like in suse is that it uses the same RPMs
as RedHat and RPMs is widely used for packaging software available via
internet. Is Ubuntu supports RPMs too?

I think it's widely regarded as a Bad Idea to mix packages between
distributions.

I would suggest Ubuntu (or Debian Sid if you are interested in getting
newer versions of GHC).  I think you'd find it difficult to find
software that wasn't already in Ubuntu's multiverse repository.

/M

-- 
Magnus Therning (OpenPGP: 0xAB4DFBA4)
[EMAIL PROTECTED] Jabber: [EMAIL PROTECTED]
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

`In those days spirits were brave, the stakes were high, men were REAL
men, women were REAL women, and small furry creatures from Alpha
Centauri were REAL small furry creatures from Aplha Centauri.'

-- The Book getting all nostalgic.


pgpxFoyAG5xw8.pgp
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Luis F. Araujo
Iván Pérez Domínguez wrote:
 Neil Mitchell wrote:
   
 Hi Bulat,

 
 afaik, there are just two good enough libs - wxHaskell and GtkHs. can
 anyone point (or write) detailed comparison of their features? i plan
 to write large GUI program in Haskell and want to select best one.
 the requirements that i can imagine at this moment is the following:
   
 I used to use wxHaskell.
 

 So did I. I tried gtk2hs as well. In my experience, gtk2hs is more
 complicated. On the other hand, gtk2hs supports glade, I think.
   
OK, i feel like i need to give my personal opinion about this.

I have been using Gtk2Hs since a bit more of a year now, and though
i don't consider myself a GUI guy, i gotta say it  _has_ been very easy
to use for me.

Most of the operations while reasoning in terms of the gtk2hs API
summarizes up on:

- Creating windows
- Creating and adding containers into these windows with a specific layout.
- Creating and adding objects (widgets) inside these containers.
- Link widget-specific events with Haskell functions implementing the
desired
functionality.

Each of these general operations translate to very well defined functions,
making it a very concise and easy-to-use API imho; plus you have
the automatic garbage collection feature.

Besides that, you have plenty of very good documentation on the gtk2hs
web site;
even with a hoogle interface to search on the API.

I really don't see where it is the complicated part.
 wxHaskell seems to be easier to understand and to use. In my case, I
 took a reversi game from haskell.org and did a sudoku game in a few
 weeks (with no prior knowledge on wxHaskell).

  I wanted to write a GUI program using GHC
   
 6.4.2 and was (disturbingly) shocked to find out that _neither_ of the
 GUI toolkits had prebuilt packages that worked on Windows with GHC
 6.4.2. I complained and within a day Duncan had done one for Gtk2Hs,
 and to my knowledge wxHaskell still doesn't have such a packaged
 version.

 

 I'm using Gentoo Linux. We obviously don't use prebuilt packaged
 versions, but installing it is just doing emerge wxhaskell and
 'playing the... waiting game'. Gtk2hs support under Gentoo is mostly
 missing (the package is included, but doesn't work at all).

   
We even have a gtk2hs darcs repository (optional to the stable package)
version available on
Gentoo through the Haskell overlay.

Though we appreciate if you give us more detail about the 'missing' support.

 For this reason, I would recommend Gtk2Hs - the level of support and
 maintainership is far better than wxHaskell at the moment. I
 appreciate wxHaskell has new maintainers, but when picking a GUI
 toolkit where you can't easily switch later, currently maintained is a
 big bullet point for me!
 
I agree.

Regards,
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Luis F. Araujo
Bulat Ziganshin wrote:
 third: are there any appetizers demonstrating features of each
 library and with source code available for studying? except for
 memory.pdf which don't mention where full source can be downloaded

 it will be interesting to see sources of more business-like
 applications developed with both libs. if there are no ones, may be i
 will develop basic file manager utility as such appetizer
   
There are plenty of nice gtk2hs examples out there.

You can take a look at [1]himerge, one of the applications i've been
developing
with gtk2hs as an example, which uses several features and common
functionalities for most GUI.

Regards,

[1] http://www.arjox.org/himerge.html

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[4]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Duncan Coutts
On Mon, 2006-11-13 at 16:48 +0300, Bulat Ziganshin wrote:
 Hello Duncan,
 
 Monday, November 13, 2006, 4:10:03 PM, you wrote:
 
 on the download page only GHC 6.4.1 support mentioned. is 6.4.2 and
 6.6 supported on windows?

The last official release for Windows supports GHC 6.2.2 and 6.4.1. I
made another build for 6.4.2 here:
http://haskell.org/~duncan/gtk2hs/gtk2hs-0.9.10.exe

 on linux?

It builds from source fine on linux. There are also packages for some
distros, like Gentoo, Debian, Fedora etc.

As for 6.6, the current development version works fine with 6.6 and so
of course the forthcoming release will do to. There will be new binary
builds for windows too.

 where i can read about forthcoming gtk2hs version and when it will be
 released?

You can subscribe to the gtk2hs-users list to get advance notice of the
release and help with testing for your favourite platform. We're aiming
for a 0.9.11 release before Christmas.

This release will change the API slightly so we want to make sure we get
it right. We don't want to have to change the api often as it's
annoying. So I hope you understand why it will not be released
immediately. Of course you are welcome to use the development version in
the meantime. This release cycle has been rather longer than we would
have liked, I expect the next one will be much shorter.

Details are on the Gtk2Hs website of how to subscribe to the mailing
list and how to get the development version with darcs:
http://haskell.org/gtk2hs/development/

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Duncan Coutts
On Mon, 2006-11-13 at 18:00 +, Tim Docker wrote:
  afaik, there are just two good enough libs - wxHaskell and GtkHs. can
  anyone point (or write) detailed comparison of their features?
 
 One point in wxHaskell's favour is that it supports Mac OS X directly. At
 present, to the best of my knowledge, you can only run GtkHs applications
 on OS X using the X Windows server. Whilst this works, it's a _long_ way
 from native look and feel.

This is quite true. Fortunately the Gtk+ folk are well underway with a
project to make it all more native looking. The latest released version
of Gtk+ 2.10.x has 'experimental' support for running on OSX without
using X11. The next step (apart from general bug fixing) is to use the
right native theme.

So yes, at the moment it doesn't look native on OSX but hopefully in the
future it will. You can read more about that here:

http://developer.imendio.com/projects/gtk-macosx

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[6]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Duncan Coutts
On Mon, 2006-11-13 at 17:10 +0300, Bulat Ziganshin wrote:

   The one thing you should be aware of is that Windows + Threading +
   Gtk2Hs + Gtk + GHC = Pain.
 
  why? are you tried to call Gtk2Hs from only one thread?
 
  I think so, yes. Or there are bizare -threaded restrictions. Only
  Duncan (and perhaps Simon Marlow) understand this. I merely got bit by
  it...
 
 it will be great to see comments about this. it's impossible to write
 my program without using threaded RTS

This is a problem for all GUI libs, it's not something that's different
between Gtk2Hs and wxHaskell. I think the problem is better understood
in Gtk2Hs because we have tried to tackle it.

I've written some multi-threaded GUI apps when using the single-threaded
RTS. I have no idea if you can use threads with wxHaskell, you'd have to
ask someone who knows more about it.

As for the threaded RTS, currently that's only ok if you never make GUI
calls from more than one Haskell thread. The reason for the restriction
is that GUI libs like wxWiddgets and Gtk+ are really designed to be used
in a single threaded manner[1]. I know Gtk+ does have some support for
using multiple threads but it requires a lot of explicit locking so it's
not easy to use from Haskell where we expect to be able to use light
weight threads with ease.

The problem at the moment with GUIs and GHC's threaded RTS is that there
is now way to specify that all the Haskell threads that want to do GUI
stuff must run on a single OS thread. It's not impossible to solve but
it requires either more support from the RTS or it needs a totally
different approach, perhaps using a Haskell-level threading GUI monad
rather than the IO monad.

Duncan


[1] in fact on windows it's even worse, not only must there be no
concurrent modification of GUI objects but the windows GDI enforces that
*only* the thread that created an object may access/modify that object.
That's a pretty severe restriction which is why we would normally say
that the GUI is just single threaded rather than going into the nasty
details of how exactly you really do GUIs with multiple OS threads. It's
so hard to do that it's effectively just single threaded.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Donn Cave
I notice that the Socket returned by ghc Network.Socket (socket) has
been set non-blocking.  (Noticed empirically, not from documentation.)

The Network.Socket functions that use it, e.g., recv, are ready for
that, of course, but as a general rule, external functions that
expect a socket are very likely not.  So I hacked up a crude fcntl
call to undo the damage and restore my socket to normal default mode,
but it makes me wonder what moved the ghc library authors to depart
from common usage in this respect, and provide no obvious means for
the programmer to restore the normal mode?

Threads, maybe?  Is blocking I/O seriously incompatible with the GHC
threading model (or one of the models)?  If I have external library
functions that use socket I/O internally, e.g., an OpenLDAP interface,
that's effectively the same as a blocking socket created in Haskell,
so whatever problem with one is the same with the other, right?

thanks,
Donn Cave, [EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[8]: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Bulat Ziganshin
Hello Duncan,

Monday, November 13, 2006, 10:19:16 PM, you wrote:

  why? are you tried to call Gtk2Hs from only one thread?
 it will be great to see comments about this. it's impossible to write
 my program without using threaded RTS

 As for the threaded RTS, currently that's only ok if you never make GUI
 calls from more than one Haskell thread.

it is what i say about. threaded RTS + multipls threads that does
computations + one thread that interfaces with Gtk2Hs. afaiu, the only
problem is that i need to manage both Gtk events and periodically
check queue of commands from other threads, but using timer + Chan
should allow to implement this

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] non-blocking Socket

2006-11-13 Thread Donn Cave
[reposted with improved subject]

I notice that the Socket returned by ghc Network.Socket (socket) has
been set non-blocking.  (Noticed empirically, not from documentation.)

The Network.Socket functions that use it, e.g., recv, are ready for
that, of course, but as a general rule, external functions that
expect a socket are very likely not.  So I hacked up a crude fcntl
call to undo the damage and restore my socket to normal default mode,
but it makes me wonder what moved the ghc library authors to depart
from common usage in this respect, and provide no obvious means for
the programmer to restore the normal mode?

Threads, maybe?  Is blocking I/O seriously incompatible with the GHC
threading model (or one of the models)?  If I have external library
functions that use socket I/O internally, e.g., an OpenLDAP interface,
that's effectively the same as a blocking socket created in Haskell,
so whatever problem with one is the same with the other, right?

thanks,
Donn Cave, [EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Ben Moseley

Has anyone succeeded in getting it running on OSX/intel at all?

...I had a brief go a few weeks back, managed to get the Cairo Clock  
running, but anything that used GTK seemed to blow up instantly. (OSX/ 
ppc was fine).


--Ben

On 13 Nov 2006, at 19:03, Duncan Coutts wrote:


On Mon, 2006-11-13 at 18:00 +, Tim Docker wrote:
afaik, there are just two good enough libs - wxHaskell and GtkHs.  
can

anyone point (or write) detailed comparison of their features?


One point in wxHaskell's favour is that it supports Mac OS X  
directly. At
present, to the best of my knowledge, you can only run GtkHs  
applications
on OS X using the X Windows server. Whilst this works, it's a  
_long_ way

from native look and feel.


This is quite true. Fortunately the Gtk+ folk are well underway with a
project to make it all more native looking. The latest released  
version

of Gtk+ 2.10.x has 'experimental' support for running on OSX without
using X11. The next step (apart from general bug fixing) is to use the
right native theme.

So yes, at the moment it doesn't look native on OSX but hopefully  
in the

future it will. You can read more about that here:

http://developer.imendio.com/projects/gtk-macosx

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Duncan Coutts
On Mon, 2006-11-13 at 20:49 +, Ben Moseley wrote:
 Has anyone succeeded in getting it running on OSX/intel at all?

I'm not sure actually. I seem to recall someone trying it but I can't
remember who now.

cc-ing to gtk2hs-users in case anyone knows: has anyone on OSX tried the
new Gtk+ 2.10.x that doesn't use X11?

 ...I had a brief go a few weeks back, managed to get the Cairo Clock  
 running, but anything that used GTK seemed to blow up instantly. (OSX/ 
 ppc was fine).

Did you try any of the C examples, like gtk-demo? I'm afraid I don't
have access to OSX.

We're actually looking for someone to help with maintaining Gtk2Hs on
OSX (and someone for windows too). So if you're interested or know
anyone who is interested then do get in touch.

Duncan

 On 13 Nov 2006, at 19:03, Duncan Coutts wrote:

  One point in wxHaskell's favour is that it supports Mac OS X  
  directly. At present, to the best of my knowledge, you can only run
  GtkHs applications on OS X using the X Windows server. Whilst this
  works, it's a _long_ way from native look and feel.
 
  This is quite true. Fortunately the Gtk+ folk are well underway with
  a project to make it all more native looking. The latest released
  version of Gtk+ 2.10.x has 'experimental' support for running on OSX
  without using X11. The next step (apart from general bug fixing) is
  to use the right native theme.
 
  So yes, at the moment it doesn't look native on OSX but hopefully  
  in the future it will. You can read more about that here:
 
  http://developer.imendio.com/projects/gtk-macosx


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] what GUI library should i select?

2006-11-13 Thread Ben Moseley

gtk-demo seemed to run fine.

--Ben

On 13 Nov 2006, at 21:01, Duncan Coutts wrote:


On Mon, 2006-11-13 at 20:49 +, Ben Moseley wrote:

Has anyone succeeded in getting it running on OSX/intel at all?


I'm not sure actually. I seem to recall someone trying it but I can't
remember who now.

cc-ing to gtk2hs-users in case anyone knows: has anyone on OSX  
tried the

new Gtk+ 2.10.x that doesn't use X11?


...I had a brief go a few weeks back, managed to get the Cairo Clock
running, but anything that used GTK seemed to blow up instantly.  
(OSX/

ppc was fine).


Did you try any of the C examples, like gtk-demo? I'm afraid I don't
have access to OSX.

We're actually looking for someone to help with maintaining Gtk2Hs on
OSX (and someone for windows too). So if you're interested or know
anyone who is interested then do get in touch.

Duncan


On 13 Nov 2006, at 19:03, Duncan Coutts wrote:



One point in wxHaskell's favour is that it supports Mac OS X
directly. At present, to the best of my knowledge, you can only run
GtkHs applications on OS X using the X Windows server. Whilst this
works, it's a _long_ way from native look and feel.


This is quite true. Fortunately the Gtk+ folk are well underway with
a project to make it all more native looking. The latest released
version of Gtk+ 2.10.x has 'experimental' support for running on OSX
without using X11. The next step (apart from general bug fixing) is
to use the right native theme.

So yes, at the moment it doesn't look native on OSX but hopefully
in the future it will. You can read more about that here:

http://developer.imendio.com/projects/gtk-macosx





___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] best Linux for GHC?

2006-11-13 Thread Murray Gross




as RedHat and RPMs is widely used for packaging software available via
internet. Is Ubuntu supports RPMs too?


I think it's widely regarded as a Bad Idea to mix packages between
distributions.

I would suggest Ubuntu (or Debian Sid if you are interested in getting
newer versions of GHC).  I think you'd find it difficult to find
software that wasn't already in Ubuntu's multiverse repository.

Please note: Debian does support RPM, either as RPM's, or by conversion 
(through the alien utility) to DEB's. My experience with such mixing is 
that it usually goes fine without any problems, although now and again, a 
bit of tinkering is necessary.


Murray Gross

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe