Re: [Haskell-cafe] Re: Haskell Logo write-in candidate

2009-03-21 Thread Anton Tayanovskyy
 I propose to use concordet voting to appoint a new king from the 100
 aspiring candidates ... ;)

Good point.. Just noticed that I managed to misspell Don Stewart's
name :( Sorry! And thanks for pointing that out!

Speaking of Concordet voiting.. :)

Have you checked out Arrow's impossibility theorem?

http://en.wikipedia.org/wiki/Arrow%27s_impossibility_theorem

Dictatorship is the best!

And to help appoint a king, I suggest this procedure:

First, everyone who wants to be a king puts his name on a wiki page.

Then,

 king = candidates ! maxBound `mod` length candidates


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


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Hans Aberg

On 21 Mar 2009, at 01:10, Brandon S. Allbery KF8NH wrote:


On 2009 Mar 20, at 17:02, Hans Aberg wrote:
Therefore, as mentioned before, it might be best to install the GHC  
binaries and install libraries like Gtk+ from MacPorts. There is  
also Intel Gtk+ that binds directly to Aqua, the


This won;t work as you expect:  since there's a dependency on ghc,  
the ports version of ghc will be installed.  (No, it doesn't behave  
like BSD ports, and can't:  breaking base, which is outside of  
their control, could have severe consequences, so it doesn't simply  
accept installed versions of programs.)



I'm not sure what you are saying here: installing MacPorts Gtk does  
not cause its GHC to be installed, nor does it bind to it.


The way it works with Gnat, is that there is a GtkAda package which  
binds to Gtk, and the paths of this package must be set to whatever  
Gtk one is using. Using an external Gnat binding to MacPorts Gtk works  
just fine. As for the Intel Gtk package that binds to to Aqua, it is  
integrated with the Xcode GCC. So one must do some extra tweaking there.


  Hans Aberg


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


[Haskell-cafe] Re: Haskell Logo write-in candidate

2009-03-21 Thread Jon Fairbairn
Warren Harris warrensomeb...@gmail.com writes:

 Hi Jon,

 I agree with much of your rant, and would agree that the
 logo is  probably the least interesting about haskell, but I
 think that it's  worth spending a little time to spiffy up
 haskell's image from a  marketing perspective.

I don't disagree with that. I'm complaining about the
method...

 Although I downplayed much of my design decisions by
 focusing on the logo's t-shirt potential, I just wanted to
 say that a lot of thought did go into the design aspects
 of what I sent out.

I don't dispute that either. My point (about lack of
justification) was not that people didn't put thought into
their efforts, but that there's no mention of it on the
listing.


 A logo needs to be a crisp graphic, needs to draw people
 in who don't yet understand (pure lazy fun-- huh? or
 what's with that Amtrak symbol?)

That's where that particular design falls down. = is an
ugly symbol in the first place, and while the pun with a
lambda in the middle provides some intellectual
satisfaction, it doesn't outweigh the fussiness of its shape
or the irrelevant associations. I hadn't thought of Amtrak,
but it made me think of the flags of Mozambique and South
Africa.

 This is all off in the realm of marketing psychology,
 which is a far cry from programming language design, but
 important in the overall product perception nonetheless.

Again, I don't dispute the importance, but...


 The other thing about this logo design that is so great is
 the  community process that's creating it. It's the open
 source process in  a nutshell -- the brightest minds playing
 off each other to build  something bigger than the sum of
 the parts.

That could happen, but a vote by people who haven't been
given a clue isn't the way to get there.

 So even if the new logo ends up looking like something
 that rolled down hill collecting rubbish, the story behind
 it will be brilliant -- like a family photo reflecting who
 we are and how we do things here.

Maybe so, but the story isn't what's important as far as
your first point is concerned.

 I hesitated in sending my write-in candidate in the first
 place  because I didn't want to derail the process that's
 underway,

derailing it is necessary if we are to get the brightest
minds playing off each other

 Now at the risk of further muddling things, I'll just say
 that I like your idea of focusing on the :: symbol, and
 just wanted to provide my interpretation:

That design is more like it! I would vote for that.

 I think that's not bad either, although I think it loses a
 little of  the distinction and intrigue of Pollard's lovely
 monad/lambda symbol  with its curved edges.

In the absence of the :: version, I'd might go for that one,
but I think it really isn't simple enough, though to
properly decide between them, we'd have to try them out on
non-Haskellers.

-- 
Jón Fairbairn jon.fairba...@cl.cam.ac.uk

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


[Haskell-cafe] Re: Haskell Logo write-in candidate

2009-03-21 Thread Achim Schneider
Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote:

 That's where that particular design falls down. = is an
 ugly symbol in the first place, and while the pun with a
 lambda in the middle provides some intellectual
 satisfaction, it doesn't outweigh the fussiness of its shape
 or the irrelevant associations. I hadn't thought of Amtrak,
 but it made me think of the flags of Mozambique and South
 Africa.

I had to google for Amtrak, I didn't know they even existed. I did know
that Mozambique and South Africa exist, and googling up their flags I
discovered that there are as many resemblances to lambda-bind as there
are to the Logo to the Deutsche Bank. Amtrak looks wholly different to
me: It doesn't even have straight lines, and it's 3d.

:: might be truly Haskell in the sense that everybody else uses
plain :, but I don't want Haskell to be associated with squareness, and
typing, by itself, is hardly a distinguishing property of Haskell.
Furthermore, squares are inherently unstable. Choosing some form of a
lambda would be the equivalent of a resistance group choosing a fist as
logo: It's been done way to often.

Uhh we could use -- . Implies do-notation. 

Lambda-bind ISN'T UGLY. I wouldn't only wear it as a t-shirt, I'd even
paint it on a spaceship. If it's busy, then too are the Windoze and Sun
logos, and if non-business is the sole criterion, we should go with a
blank logo, saying Haskell is the Zen of Programming.

I bet there are some design-experienced people involved in all this,
there are way too many well-balanced proposals on the logo list for this
not to be true: They just didn't out themselves explicitely.


Some time ago, my proposal was to do two votes: First choose the logo,
then colour scheme and layout with text etc. Right now, doing three
seems wiser: The current, first one to weed out a bulk of unpopular
logos, the second to choose one of the popular ones after we've made up
our minds about what those logos signify, and finally the third,
colour/layout vote. Condorcet voting _should_ actually get rid of the
need for the second one, but then, as always, people start to notice
that they want to go on a train only after it has left the station.
Furthermore, some people seem to be of the oppinion that choosing a
couple of favourites and moving them to the top involves dealing with
100+ options, which it of course does, but doesn't. Ignorance is
Strength.


Voting for a slogan would be a good Idea, too. There's the quite old
We put the funk in function, pure - lazy - fun, pure - lazy -
fun(ctional) purely functional (functionally pure? pure
functionality?), being lazy with class, warm and fuzzy, bind the
real world, YEEEAAAHH, Freedom from state, Just Haskell, and
probably a couple of others.


Then there's the mascot topic: We could have Monica Monad sitting on
a lamda-bind, a sloth hanging from it... It makes the whole thing more
alive, and can be left out at small scales and on space ships. Maybe we
can bribe Tux with some fish, he's on forced vacation right now.


-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.


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


Re: [Haskell-cafe] Re: Haskell Logo write-in candidate

2009-03-21 Thread Brent Yorgey
On Sat, Mar 21, 2009 at 12:52:49PM +0100, Achim Schneider wrote:
 Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote:
 
  That's where that particular design falls down. = is an
  ugly symbol in the first place, and while the pun with a
  lambda in the middle provides some intellectual
  satisfaction, it doesn't outweigh the fussiness of its shape
  or the irrelevant associations. I hadn't thought of Amtrak,
  but it made me think of the flags of Mozambique and South
  Africa.
 
 I had to google for Amtrak, I didn't know they even existed. I did know
 that Mozambique and South Africa exist, and googling up their flags I
 discovered that there are as many resemblances to lambda-bind as there
 are to the Logo to the Deutsche Bank. Amtrak looks wholly different to
 me: It doesn't even have straight lines, and it's 3d.
 

Amtrak changed their logo in 2000; the old logo looked like =.  See
the wikipedia article.  Amusingly, I also learned from the wikipedia
article that critics dubbed this logo the pointless arrow.  =)

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


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Duncan Coutts
On Fri, 2009-03-20 at 14:10 -0400, Jeff Heard wrote:
 cabal-install works for me.  The one thing that would be REALLY REALLY
 nice (and I'm cc-ing Duncan on this) is a .dmg for Gtk2Hs on Mac OS X.

I'm sorry I can't directly help with this. I have no access to any
hardware running OS X. I presume you've also asked on the gtk2hs-users
mailing list?

Duncan

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


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Duncan Coutts
On Fri, 2009-03-20 at 15:22 -0400, Jeff Heard wrote:
 As this continues to build, I guess the issue for me, and I'm willing
 to help with it, is trying to figure out how to redistribute programs
 written with gtk2hs.  on Windows, people can just install the gtk2hs
 libraries via the installer -- although this does bork a little
 because it assumes you have a haskell compiler on the machine.

It's quite possible to make a Windows installer that just bundles the
Gtk+ dlls and does not need ghc etc. For example, here's a demo:

http://haskell.org/~duncan/gtk2hs/LSystemSetup.exe

It's an installer (built using InnoSetup - which is Free software) for a
Haskell program that uses gtk2hs and opengl. It installs on a clean
machine, no gtk2hs or ghc is required.

Constructing such an installer is not hard. The zip files containing all
the necessary gtk dlls are available so it's just a matter of the
installing them all along with your application .exe file.

Duncan

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


[Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Manlio Perillo

Hi.

Assuming this configuration fragment:

library xxx
cc-options: -Wall

if flag(HAVE_URANDOM)
cc-options:-DHAVE_URANDOM

In case the HAVE_URANDOM flag is defined, what will be the value of the 
used cc-options?

1) -DHAHE_URANDOM
2) -Wall -DHAHE_URANDOM


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


[Haskell-cafe] Haskell Weekly News: Issue 110 - March 21, 2009

2009-03-21 Thread Brent Yorgey
---
Haskell Weekly News
http://sequence.complete.org/hwn/20090321
Issue 110 - March 21, 2009
---

   Welcome to issue 110 of HWN, a newsletter covering developments in the
   [1]Haskell community.

   [2]Facebook apps with Happstack, [3]Sudoku with Cryptol, what next?
   Tic-tac-toe with darcs? Anyway, lots of neat stuff this week, including
   new releases of [4]GHC, [5]jhc, and the [6]Monad.Reader, some [7]fun
   [8]visualizations, and more. Also, students: apply to work on a
   [9]Haskell project for the Google Summer of Code!

Announcements

   GHC 6.10.2 Release Candidate 1. Ian Lynagh [10]announced the [11]first
   release candidate for GHC 6.10.2. Please test as much as possible; bugs
   are much cheaper if we find them before the release!

   jhc 0.6.0 Haskell Compiler. John Meacham [12]announced the release of
   [13]jhc 0.6.0.

   Safe Lazy IO in Haskell. Nicolas Pouillard [14]announced the
   [15]safe-lazy-io package that provides special types and combinators
   for performing safe lazy I/O.

   game-tree - a library for searching game trees. Colin Paul Adams
   [16]announced [17]game-tree 0.1.0.0, which provides a class for dynamic
   game trees, and purely functional algorithms for searching them.

   random-shuffle package. Manlio Perillo [18]announced the availability
   of the [19]random-shuffle package, which is based on [20]Oleg's
   description.

   random-stream package. Manlio Perillo [21]announced the
   [22]random-stream package, which provides a portable interface for the
   operating system source of pseudo random data. Supported sources are
   Unix /dev/urandom, Win32 CryptGenRandom and OpenSSL pseudo random
   numbers generator.

   language-python. Bernie Pope [23]announced the [24]language-python
   package, which provides a parser (and lexer) for Python, written in
   Haskell. Currently it only supports version 3 of Python (the most
   recent version), but it will support version 2 in the future.

   Google Summer of Code. Malcolm Wallace [25]announced that haskell.org
   has once again been accepted as a mentoring organisation for the 2009
   Google Summer of Code. Student applications open on Monday (23rd March)
   at 1900 UTC, for a period of 12 days (until Fri 3rd April, also at 1900
   UTC). Students applicants are encouraged to interact with the community
   via mailing lists, prior, during, and after the submission of their
   ideas for projects. Because (sadly) the darcs community did not get
   accepted as a separate organisation this year, haskell.org will be
   willing to accept proposals relating to darcs.

   regex-tdfa-1.1.0. ChrisK [26]announced the release of
   [27]regex-tdfa-1.1.0. This version is a small performance update to the
   old regex-tdfa-1.0.0 version. Previously all text (e.g. ByteString)
   being search was converted to String and sent through a single engine;
   the new version uses a type class and SPECIALIZE pragmas to avoid
   converting to String. This should make adding support for searching
   other Char containers easy to do.

   Haskell on your system? Information wanted!. Don Stewart [28]announced
   that haskell.org now features links to wiki pages explaining how to
   obtain Haskell on windows, mac osx and linux and bsd. If you're a
   distro maintainer for these systems, please consider adding relevant
   pointers to the pages, so that users of these systems can find all the
   info they need.

   libffi 0.1 released. Remi Turk [29]announced the release of [30]libffi
   0.1, bindings to the C library libffi, allowing C functions to be
   called whose types are not known before run-time.

   Haskell Logo Voting has started!. Eelco Lempsink [31]announced that
   voting has begun to choose the new Haskell logo. All subscribed to
   haskell-cafe should have received a ballot; if you are not directly
   subscribed, you can still send ballot requests until the end of the
   competition (March 24, 12:00 UTC). Make sure the message contains
   'haskell logo voting ballot request' in the subject. A long discussion
   of what color to paint the bike shed and why this particular bike shed
   will not do for storing bikes ensued.

   The Monad.Reader (13). Wouter Swierstra [32]announced that a new issue
   of [33]The Monad.Reader, a quarterly magazine about functional
   programming, is now available. Issue 13 consists of the following four
   articles: Rapid Prototyping in TEX by Stephen Hicks; The
   Typeclassopedia by Brent Yorgey; a Real World Haskell book review by
   Chris Eidhof and Eelco Lempsink; and Calculating Monads with Category
   Theory by Derek Elkins.

   dzen-utils 0.1. Felipe Lessa [34]announced the release of
   [35]dzen-utils 0.1, which contains various utilities for creating dzen
   input strings in a type-safe way using some combinators, including the
   ability to apply colors

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Colin Paul Adams
 Ross == Ross Mellgren rmm-hask...@z.odi.ac writes:

Ross While there is not a .dmg for Gtk2Hs, you can use a .dmg
Ross installed GHC with a .dmg installed Gtk, and then build
Ross gtk2hs straight on top of that, without having to deal with
Ross the dual-GHC macports mess..

Ross 
http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework

I just tried this.

The configure enables cairo, but does not enable svgcairo. Is there
anyway round this, or do I have to revert to the macports gtk? (my
application uses svgcairo)
-- 
Colin Adams
Preston Lancashire
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: A guess on stack-overflows - thunks build-up and tail recursion

2009-03-21 Thread G?uenther Schmidt

Hi Bas,


I'd like to share some thoughts with you.

Let's say I'm unable, for whatever reason, to force full evaluation of 
the accumulator during a foldl.


So I have this huge build up of thunks, which causes a stack overflow 
when the thunks are being reduced.


I wonder if I could write some sort of chunked fold which basically 
still produces the same amount of thunks but in a way so that the do not 
go on the stack all at once for reduction and thus do not cause a stack 
overflow. Kind of a tree.


I'd sincerely appreciate your thoughts on this.

Günther


Bas van Dijk schrieb:

On Fri, Mar 20, 2009 at 2:01 PM, GüŸnther Schmidt gue.schm...@web.de wrote:

The problem occurs when the result value is needed and thus the thunks need
to be reduced, starting with the outermost, which can't be reduced without
reducing the next one  etc and it's these reduction steps that are
pushed on the stack until its size cause a stack-overflow.


Oh yes of course! Indeed a foldl:

foldl f z [] = z
foldl f z (x:xs) = foldl f (z `f` x) xs

Is compiled to:

foldl f z xs = case xs of
 [] - z
 (x:xs) - let z' = f z x
   in foldl f z' x

So the z' is allocated on the heap.

So it turns out that in my  Foldr Foldl Foldl'  article the stack
overflow message is listed to soon. It should actually be lised after
the:

((0 + 1) + 2) + 3) + 4) + ...) + 99) + 100

I will fix it when I get home from work and nobody has beat me to it.

Thanks for pointing this out!

regards,

Bas



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


[Haskell-cafe] Re: [Haskell-beginners] appropriateness of haskell for GUIs

2009-03-21 Thread Adrian Neumann


Am 21.03.2009 um 13:30 schrieb Michael Mossey:




Thomas Davie wrote:

On 21 Mar 2009, at 00:16, Michael P Mossey wrote:
Hello, I'm totally new to Haskell. I'm thinking of using it for a  
personal project, which is a gui-based musical score editor.
The rough situation of GUI programming on Haskell is that it works  
just as well as in any imperative programming language.  This is  
rather disappointing, simply because so many other things are  
massively easier in Haskell, and this isn't true of GUI  
programming (yet).


Hi Bob,

I can imagine that GUI programming is no easier (yet). It is  
inherently very stateful. GUI's have modes, such as which screens  
are displayed, which dialogs are displayed, which options within  
those dialogs are valid given the other state of the program, etc.  
When I write GUIs, I often diagram them as state machines to get a  
handle on what's going on.


So, I'm not familiar with GUI programming on Haskell, but would you  
say the statefulness of GUIs (in their typical implementations) is  
the reason they are no easier on Haskell?


I strongly prefer to use qtHaskell because I'm familiar with Qt,  
and Qt is extremely capable. For example, it can draw text and  
shapes with antialiasing, which will be great for a music score  
editor. Music scores have lots of small shapes to fit on the  
screen, and antialiasing will provide ease of reading. I don't know  
how much of Qt is implemented in qtHaskell, or whether the latest  
version of Qt (4.4) is implemented.


Thanks,
Mike


The main problem is, as far as I know, the complete lack of any  
usable GUI designer. You have to type everything yourself. That's  
very annoying. It's a lot easier in other languages because your  
tools take away the cumbersome twiddling with widgets.


However, I haven't googled. Maybe the situation has changed since I  
last looked.


Regards,

Adrian


PGP.sig
Description: Signierter Teil der Nachricht
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: [Haskell-beginners] laziness and optimization

2009-03-21 Thread Adrian Neumann
You should not rely on the compiler to spot such things. As far as I  
know GHC doesn't do automatic caching (in many cases that would hurt  
performance, I think). Have a look at http://haskell.org/haskellwiki/ 
Memoization perhaps.



Am 21.03.2009 um 14:02 schrieb Michael Mossey:

I understand a bit about the concept of lazy evaluation. I think  
of that as saying an imperative language would always make one  
evaluation, whereas Haskell might make 0 evaluations. I have  
another similar situation where an imperative language would make N  
evaluations of the same expression, and I would like Haskell to  
make only 1.


This is the situation: the graphical score editor displays  
LayoutItems. A LayoutItem can be a single displayed entity, like  
a round notehead, or it can be composed of several entities.


A common situation in my code is the need to determine the size and  
shape of a LayoutItem. For a fundamental item, this can be looked  
up in a table or read from the font properties. For a composite  
item, some computation is required: the code must determine the  
positions of each sub-item and compute the bounds of a shape  
containing all of them.


It's this latter computation, finding the bounds of a composite  
item, which might come up multiple times. Consider that I ask for  
the bounds of a composite-composite item (a composite item composed  
of composite items). It will run the computation associated with  
each composite sub-item, even though it is very likely I already  
make that computation when I first constructed and placed that sub- 
item.


In an imperative language, one might cache values for later lookup.  
This raises the problem of keeping the cache current to the current  
state.


So I'm wondering to what extent the haskell compiler recognizes  
computations it's done before. In a purely functional language this  
should be pretty easy, right? If it sees the same expression, it  
knows it will have the same value. That's my understanding, so far.


Thanks,
Mike
___
Beginners mailing list
beginn...@haskell.org
http://www.haskell.org/mailman/listinfo/beginners




PGP.sig
Description: Signierter Teil der Nachricht
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell-beginners] appropriateness of haskell for GUIs

2009-03-21 Thread Sebastian Sylvan
2009/3/21 Adrian Neumann aneum...@inf.fu-berlin.de


 Am 21.03.2009 um 13:30 schrieb Michael Mossey:



 Thomas Davie wrote:

 On 21 Mar 2009, at 00:16, Michael P Mossey wrote:

 Hello, I'm totally new to Haskell. I'm thinking of using it for a
 personal project, which is a gui-based musical score editor.

 The rough situation of GUI programming on Haskell is that it works just
 as well as in any imperative programming language.  This is rather
 disappointing, simply because so many other things are massively easier in
 Haskell, and this isn't true of GUI programming (yet).


 Hi Bob,

 I can imagine that GUI programming is no easier (yet). It is inherently
 very stateful. GUI's have modes, such as which screens are displayed,
 which dialogs are displayed, which options within those dialogs are valid
 given the other state of the program, etc. When I write GUIs, I often
 diagram them as state machines to get a handle on what's going on.

 So, I'm not familiar with GUI programming on Haskell, but would you say
 the statefulness of GUIs (in their typical implementations) is the reason
 they are no easier on Haskell?

 I strongly prefer to use qtHaskell because I'm familiar with Qt, and Qt is
 extremely capable. For example, it can draw text and shapes with
 antialiasing, which will be great for a music score editor. Music scores
 have lots of small shapes to fit on the screen, and antialiasing will
 provide ease of reading. I don't know how much of Qt is implemented in
 qtHaskell, or whether the latest version of Qt (4.4) is implemented.

 Thanks,
 Mike


 The main problem is, as far as I know, the complete lack of any usable GUI
 designer. You have to type everything yourself. That's very annoying. It's a
 lot easier in other languages because your tools take away the cumbersome
 twiddling with widgets.


http://en.wikipedia.org/wiki/Glade_Interface_Designer




-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell-beginners] appropriateness of haskell for GUIs

2009-03-21 Thread Brandon S. Allbery KF8NH

On 2009 Mar 21, at 10:59, Sebastian Sylvan wrote:

2009/3/21 Adrian Neumann aneum...@inf.fu-berlin.de
Am 21.03.2009 um 13:30 schrieb Michael Mossey:
Thomas Davie wrote:
On 21 Mar 2009, at 00:16, Michael P Mossey wrote:
Hello, I'm totally new to Haskell. I'm thinking of using it for a  
personal project, which is a gui-based musical score editor.
The rough situation of GUI programming on Haskell is that it works  
just as well as in any imperative programming language.  This is  
rather disappointing, simply because so many other things are  
massively easier in Haskell, and this isn't true of GUI programming  
(yet).


So, I'm not familiar with GUI programming on Haskell, but would you  
say the statefulness of GUIs (in their typical implementations) is  
the reason they are no easier on Haskell?


The main problem is, as far as I know, the complete lack of any  
usable GUI designer. You have to type everything yourself. That's  
very annoying. It's a lot easier in other languages because your  
tools take away the cumbersome twiddling with widgets.


http://en.wikipedia.org/wiki/Glade_Interface_Designer


Glade works fine if all you want is to place widgets; but it won't  
generate template code in Haskell (it will for C and C++) to connect  
the widgets together, which is what I understand from you have to  
type everything yourself.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell-beginners] laziness and optimization

2009-03-21 Thread Eugene Kirpichov
Yep.
Michael: Haskell doesn't do miracles. It has a well-defined (however,
very cool) evaluation model, and the compiler in 99.9% realistic cases
optimizes it only by a constant factor. Things can't be much better
than that because it is extremely hard or theoretically impossible
(probably by some kind of Rice's theorem) to guarantee that certain
algorithm-changing optimizations won't hurt.
(Same thing for Prolog: when I didn't know it at all, I thought that
it was a magic allmighty theorem prover; turned out that it also had a
well-defined, however very cool, evaluation model)

So, use the strictly-defined lazy evaluation model to its whole
extent, and build your own memoization :)


2009/3/21 Adrian Neumann aneum...@inf.fu-berlin.de:
 You should not rely on the compiler to spot such things. As far as I know
 GHC doesn't do automatic caching (in many cases that would hurt performance,
 I think). Have a look at http://haskell.org/haskellwiki/Memoization perhaps.


 Am 21.03.2009 um 14:02 schrieb Michael Mossey:

 I understand a bit about the concept of lazy evaluation. I think of that
 as saying an imperative language would always make one evaluation, whereas
 Haskell might make 0 evaluations. I have another similar situation where an
 imperative language would make N evaluations of the same expression, and I
 would like Haskell to make only 1.

 This is the situation: the graphical score editor displays LayoutItems.
 A LayoutItem can be a single displayed entity, like a round notehead, or it
 can be composed of several entities.

 A common situation in my code is the need to determine the size and shape
 of a LayoutItem. For a fundamental item, this can be looked up in a table or
 read from the font properties. For a composite item, some computation is
 required: the code must determine the positions of each sub-item and compute
 the bounds of a shape containing all of them.

 It's this latter computation, finding the bounds of a composite item,
 which might come up multiple times. Consider that I ask for the bounds of a
 composite-composite item (a composite item composed of composite items). It
 will run the computation associated with each composite sub-item, even
 though it is very likely I already make that computation when I first
 constructed and placed that sub-item.

 In an imperative language, one might cache values for later lookup. This
 raises the problem of keeping the cache current to the current state.

 So I'm wondering to what extent the haskell compiler recognizes
 computations it's done before. In a purely functional language this should
 be pretty easy, right? If it sees the same expression, it knows it will have
 the same value. That's my understanding, so far.

 Thanks,
 Mike
 ___
 Beginners mailing list
 beginn...@haskell.org
 http://www.haskell.org/mailman/listinfo/beginners


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





-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] [ANN] I/O library for Windows

2009-03-21 Thread Felix Martini
Hi all,

winio is an I/O library for Windows using Windows API functions and
has I/O completion port support. The main goal of this library is to
support Simon Marlow's new Handle API once he has added that to GHC.
The library also has a compatibility module for socket functions from
the network-bytestring package. Because the library uses IOCP instead
of select it is not limited to 1024 open sockets. Try for example the
thread-ring program where each Haskell thread passes a UDP message
around (Change the MaxUserPort field in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
to 65534 to enable all ports).

The winio package is available on Hackage. Notice that it uses a
development version of the network package which is available at
http://darcs.haskell.org/packages/network/. The library has not been
tested much and should be considered experimental so please try it if
you use Windows and notify me of any issue or corner case.

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


[Haskell-cafe] [GSOC] About Implementing Maps using generalized tries project idea

2009-03-21 Thread Gautam Sewani
Hi,

I was looking at the list of Haskell GSOC 2009 project ideas, and I
came across the one in which we have to implement maps using
generalized tries. However, I also found this as one of the GSOC 2008
projects. I want to know if this project is still open, or the
required work has been done last year. If it's open, what exactly
needs to be done further.

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


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
I tried making this work, but librsvg requires pango, and pango is a  
huge pain in the ass -- I managed to get the whole thing to compile,  
but now it can't find any fonts, apparently due to some dynaloading  
issues.


I think if you need any of the extended modules (e.g. svgcairo, gl)  
that the DMG doesn't directly support then you're best served by  
shedding a couple tears and going with macports.


The steps I used to get the broken version were (FYI -- doing this  
causes all fonts to load as the no-character square in all gtk2hs apps):


export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/ 
pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/ 
pkgconfig:/Library/Frameworks/GLib.framework/Resources/dev/lib/ 
pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig


export PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin

cd pango-1.24.0
CFLAGS=-DFC_WEIGHT_EXTRABLACK=215 ./configure --prefix=/usr/local
make -j4
sudo make install

cd librsvg-2.26.0
./configure --prefix=/usr/local
make -j4
sudo make install

cd gtk2hs-0.10.0
./configure --disable-gio
make -j4
sudo make install

Running apps linked with this version of gtk2hs gets:

(svgviewer:43314): Pango-CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
  '/usr/local/etc/pango/pango.modules'
You should create this file by running:
  pango-querymodules  '/usr/local/etc/pango/pango.modules'

(svgviewer:43314): Pango-WARNING **: failed to choose a font, expect  
ugly output. engine-type='PangoRenderATSUI', script='latin'


So if anyone knows what Pango is trying to do, maybe they could help  
resolve this.


I'm probably going to ditch the use of GTK in my own project and use  
FFI bindings to Carbon/Win32, since I don't really need widgets for my  
own stuff and the whole family of GTK related packages is a total pain  
in the ass (as are most things in the GNU family of software, IMO)


-Ross

On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote:


Ross == Ross Mellgren rmm-hask...@z.odi.ac writes:


   Ross While there is not a .dmg for Gtk2Hs, you can use a .dmg
   Ross installed GHC with a .dmg installed Gtk, and then build
   Ross gtk2hs straight on top of that, without having to deal with
   Ross the dual-GHC macports mess..

   Ross 
http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework

I just tried this.

The configure enables cairo, but does not enable svgcairo. Is there
anyway round this, or do I have to revert to the macports gtk? (my
application uses svgcairo)
--
Colin Adams
Preston Lancashire


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


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
Minor correction -- pango in general is installed with the .DMG of  
Gtk... it's pangoft2 (the freetype2 bindings) that librsvg requires  
and aren't provided.


-Ross

On Mar 21, 2009, at 12:35 PM, Ross Mellgren wrote:

I tried making this work, but librsvg requires pango, and pango is a  
huge pain in the ass -- I managed to get the whole thing to compile,  
but now it can't find any fonts, apparently due to some dynaloading  
issues.


I think if you need any of the extended modules (e.g. svgcairo, gl)  
that the DMG doesn't directly support then you're best served by  
shedding a couple tears and going with macports.


The steps I used to get the broken version were (FYI -- doing this  
causes all fonts to load as the no-character square in all gtk2hs  
apps):


export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/ 
pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/ 
pkgconfig:/Library/Frameworks/GLib.framework/Resources/dev/lib/ 
pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/ 
pkgconfig


export PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin

cd pango-1.24.0
CFLAGS=-DFC_WEIGHT_EXTRABLACK=215 ./configure --prefix=/usr/local
make -j4
sudo make install

cd librsvg-2.26.0
./configure --prefix=/usr/local
make -j4
sudo make install

cd gtk2hs-0.10.0
./configure --disable-gio
make -j4
sudo make install

Running apps linked with this version of gtk2hs gets:

(svgviewer:43314): Pango-CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
 '/usr/local/etc/pango/pango.modules'
You should create this file by running:
 pango-querymodules  '/usr/local/etc/pango/pango.modules'

(svgviewer:43314): Pango-WARNING **: failed to choose a font, expect  
ugly output. engine-type='PangoRenderATSUI', script='latin'


So if anyone knows what Pango is trying to do, maybe they could help  
resolve this.


I'm probably going to ditch the use of GTK in my own project and use  
FFI bindings to Carbon/Win32, since I don't really need widgets for  
my own stuff and the whole family of GTK related packages is a total  
pain in the ass (as are most things in the GNU family of software,  
IMO)


-Ross

On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote:


Ross == Ross Mellgren rmm-hask...@z.odi.ac writes:


  Ross While there is not a .dmg for Gtk2Hs, you can use a .dmg
  Ross installed GHC with a .dmg installed Gtk, and then build
  Ross gtk2hs straight on top of that, without having to deal with
  Ross the dual-GHC macports mess..

  Ross 
http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework

I just tried this.

The configure enables cairo, but does not enable svgcairo. Is there
anyway round this, or do I have to revert to the macports gtk? (my
application uses svgcairo)
--
Colin Adams
Preston Lancashire


___
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] [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Max Bolingbroke
2009/3/21 Manlio Perillo manlio_peri...@libero.it:
 Max Bolingbroke ha scritto:

 These two packages allow Haskell programs to produce much richer
 console output by allowing colorisation, emboldening and so on.


 Do you plan to extend the package to any terminal, using terminfo database?

Manlio,

I don't plan on an extension like this myself, as assuming ANSI
support is enough for all the applications I'm interested in, and I
suspect dealing with terminfo stuff will be a headache. Sorry!

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


[Haskell-cafe] Re: [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Achim Schneider
Manlio Perillo manlio_peri...@libero.it wrote:

 Do you plan to extend the package to any terminal, using terminfo
 database?

Are there any non-ansi terminals left? I assumed they were extinct...
it'd come close to using EBCDIC.

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.


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


[Haskell-cafe] [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Max Bolingbroke
These two packages allow Haskell programs to produce much richer
console output by allowing colorisation, emboldening and so on.

Both Unix-like (OS X, Linux) and Windows operating systems are
supported (via a pure Haskell ANSI emulation layer for Windows).

Examples, screenshots, and lots more information about how to get the
packages are available at the freshly-minted homepages:
http://batterseapower.github.com/ansi-terminal/
http://batterseapower.github.com/ansi-wl-pprint/

These two packages have actually been in stealth release mode on
Hackage for some time. However, they seem to be getting some use and
I'm not getting any bug reports, so I figure that they /must/ be
stable enough to make a proper announcement :-)

Cheers,
Max

(p.s: the GitHub pages feature seems to be absolutely ace - highly
reccomended! http://pages.github.com/)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Martijn van Steenbergen

Max Bolingbroke wrote:

These two packages allow Haskell programs to produce much richer
console output by allowing colorisation, emboldening and so on.


This will be a big help in my MUD driver. Thanks! :-)

Martijn.

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


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Colin Adams
If I try this, pango fails to compile with lots of error messages
about error: macro names must be identifiers.

I think I've seen this before - some well-known Mac OSX problem? (I'm
a linux man myself - so I'm not used to the mac)

2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
 I tried making this work, but librsvg requires pango, and pango is a huge
 pain in the ass -- I managed to get the whole thing to compile, but now it
 can't find any fonts, apparently due to some dynaloading issues.

 I think if you need any of the extended modules (e.g. svgcairo, gl) that the
 DMG doesn't directly support then you're best served by shedding a couple
 tears and going with macports.

 The steps I used to get the broken version were (FYI -- doing this causes
 all fonts to load as the no-character square in all gtk2hs apps):

 export
 PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig

 export PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin

 cd pango-1.24.0
 CFLAGS=-DFC_WEIGHT_EXTRABLACK=215 ./configure --prefix=/usr/local
 make -j4
 sudo make install

 cd librsvg-2.26.0
 ./configure --prefix=/usr/local
 make -j4
 sudo make install

 cd gtk2hs-0.10.0
 ./configure --disable-gio
 make -j4
 sudo make install

 Running apps linked with this version of gtk2hs gets:

 (svgviewer:43314): Pango-CRITICAL **: No modules found:
 No builtin or dynamically loaded modules were found.
 PangoFc will not work correctly.
 This probably means there was an error in the creation of:
  '/usr/local/etc/pango/pango.modules'
 You should create this file by running:
  pango-querymodules  '/usr/local/etc/pango/pango.modules'

 (svgviewer:43314): Pango-WARNING **: failed to choose a font, expect ugly
 output. engine-type='PangoRenderATSUI', script='latin'

 So if anyone knows what Pango is trying to do, maybe they could help resolve
 this.

 I'm probably going to ditch the use of GTK in my own project and use FFI
 bindings to Carbon/Win32, since I don't really need widgets for my own stuff
 and the whole family of GTK related packages is a total pain in the ass (as
 are most things in the GNU family of software, IMO)

 -Ross

 On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote:

 Ross == Ross Mellgren rmm-hask...@z.odi.ac writes:

   Ross While there is not a .dmg for Gtk2Hs, you can use a .dmg
   Ross installed GHC with a .dmg installed Gtk, and then build
   Ross gtk2hs straight on top of that, without having to deal with
   Ross the dual-GHC macports mess..

   Ross
 http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework

 I just tried this.

 The configure enables cairo, but does not enable svgcairo. Is there
 anyway round this, or do I have to revert to the macports gtk? (my
 application uses svgcairo)
 --
 Colin Adams
 Preston Lancashire

 ___
 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] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
I didn't get any errors like that (nor do I remember ever having  
them), though if you want to paste them here maybe I can help with them.


-Ross

On Mar 21, 2009, at 1:27 PM, Colin Adams wrote:


If I try this, pango fails to compile with lots of error messages
about error: macro names must be identifiers.

I think I've seen this before - some well-known Mac OSX problem? (I'm
a linux man myself - so I'm not used to the mac)

2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
I tried making this work, but librsvg requires pango, and pango is  
a huge
pain in the ass -- I managed to get the whole thing to compile, but  
now it

can't find any fonts, apparently due to some dynaloading issues.

I think if you need any of the extended modules (e.g. svgcairo, gl)  
that the
DMG doesn't directly support then you're best served by shedding a  
couple

tears and going with macports.

The steps I used to get the broken version were (FYI -- doing this  
causes

all fonts to load as the no-character square in all gtk2hs apps):

export
PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/ 
Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/ 
Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/ 
Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig


export PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/ 
bin


cd pango-1.24.0
CFLAGS=-DFC_WEIGHT_EXTRABLACK=215 ./configure --prefix=/usr/local
make -j4
sudo make install

cd librsvg-2.26.0
./configure --prefix=/usr/local
make -j4
sudo make install

cd gtk2hs-0.10.0
./configure --disable-gio
make -j4
sudo make install

Running apps linked with this version of gtk2hs gets:

(svgviewer:43314): Pango-CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
 '/usr/local/etc/pango/pango.modules'
You should create this file by running:
 pango-querymodules  '/usr/local/etc/pango/pango.modules'

(svgviewer:43314): Pango-WARNING **: failed to choose a font,  
expect ugly

output. engine-type='PangoRenderATSUI', script='latin'

So if anyone knows what Pango is trying to do, maybe they could  
help resolve

this.

I'm probably going to ditch the use of GTK in my own project and  
use FFI
bindings to Carbon/Win32, since I don't really need widgets for my  
own stuff
and the whole family of GTK related packages is a total pain in the  
ass (as

are most things in the GNU family of software, IMO)

-Ross

On Mar 21, 2009, at 10:13 AM, Colin Paul Adams wrote:


Ross == Ross Mellgren rmm-hask...@z.odi.ac writes:


  Ross While there is not a .dmg for Gtk2Hs, you can use a .dmg
  Ross installed GHC with a .dmg installed Gtk, and then build
  Ross gtk2hs straight on top of that, without having to deal with
  Ross the dual-GHC macports mess..

  Ross
http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework

I just tried this.

The configure enables cairo, but does not enable svgcairo. Is there
anyway round this, or do I have to revert to the macports gtk? (my
application uses svgcairo)
--
Colin Adams
Preston Lancashire


___
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] Ease of Haskell development on OS X?

2009-03-21 Thread Colin Adams
In file included from ../pango/pango.h:31,
 from pango-impl-utils.h:28,
 from fonts.c:30:
../pango/pango-enum-types.h:12:9: error: macro names must be identifiers
../pango/pango-enum-types.h:14:9: error: macro names must be identifiers
../pango/pango-enum-types.h:17:9: error: macro names must be identifiers
../pango/pango-enum-types.h:19:9: error: macro names must be identifiers
../pango/pango-enum-types.h:22:9: error: macro names must be identifiers
../pango/pango-enum-types.h:25:9: error: macro names must be identifiers
../pango/pango-enum-types.h:27:9: error: macro names must be identifiers
../pango/pango-enum-types.h:29:9: error: macro names must be identifiers
../pango/pango-enum-types.h:31:9: error: macro names must be identifiers
../pango/pango-enum-types.h:33:9: error: macro names must be identifiers
../pango/pango-enum-types.h:36:9: error: macro names must be identifiers
../pango/pango-enum-types.h:38:9: error: macro names must be identifiers
../pango/pango-enum-types.h:41:9: error: macro names must be identifiers
../pango/pango-enum-types.h:43:9: error: macro names must be identifiers
../pango/pango-enum-types.h:45:9: error: macro names must be identifiers
../pango/pango-enum-types.h:48:9: error: macro names must be identifiers
../pango/pango-enum-types.h:51:9: error: macro names must be identifiers
../pango/pango-enum-types.h:54:9: error: macro names must be identifiers
In file included from ../pango/pango.h:31,
 from pango-impl-utils.h:28,
 from glyphstring.c:26:
../pango/pango-enum-types.h:12:9: error: macro names must be identifiers
../pango/pango-enum-types.h:14:9: error: macro names must be identifiers
../pango/pango-enum-types.h:17:9: error: macro names must be identifiers
../pango/pango-enum-types.h:19:9: error: macro names must be identifiers
../pango/pango-enum-types.h:22:9: error: macro names must be identifiers
../pango/pango-enum-types.h:25:9: error: macro names must be identifiers
../pango/pango-enum-types.h:27:9: error: macro names must be identifiers
../pango/pango-enum-types.h:29:9: error: macro names must be identifiers
../pango/pango-enum-types.h:31:9: error: macro names must be identifiers
../pango/pango-enum-types.h:33:9: error: macro names must be identifiers
../pango/pango-enum-types.h:36:9: error: macro names must be identifiers
../pango/pango-enum-types.h:38:9: error: macro names must be identifiers
../pango/pango-enum-types.h:41:9: error: macro names must be identifiers
../pango/pango-enum-types.h:43:9: error: macro names must be identifiers
../pango/pango-enum-types.h:45:9: error: macro names must be identifiers
../pango/pango-enum-types.h:48:9: error: macro names must be identifiers
../pango/pango-enum-types.h:51:9: error: macro names must be identifiers
../pango/pango-enum-types.h:54:9: error: macro names must be identifiers


2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
 I didn't get any errors like that (nor do I remember ever having them),
 though if you want to paste them here maybe I can help with them.

 -Ross

 On Mar 21, 2009, at 1:27 PM, Colin Adams wrote:

 If I try this, pango fails to compile with lots of error messages
 about error: macro names must be identifiers.

 I think I've seen this before - some well-known Mac OSX problem? (I'm
 a linux man myself - so I'm not used to the mac)

 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 I tried making this work, but librsvg requires pango, and pango is a huge
 pain in the ass -- I managed to get the whole thing to compile, but now
 it
 can't find any fonts, apparently due to some dynaloading issues.

 I think if you need any of the extended modules (e.g. svgcairo, gl) that
 the
 DMG doesn't directly support then you're best served by shedding a couple
 tears and going with macports.

 The steps I used to get the broken version were (FYI -- doing this causes
 all fonts to load as the no-character square in all gtk2hs apps):

 export

 PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/Library/Frameworks/Cairo.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/GLib.framework/Resources/dev/lib/pkgconfig:/Library/Frameworks/Gtk.framework/Resources/dev/lib/pkgconfig

 export PATH=$PATH:/Library/Frameworks/GLib.framework/Resources/dev/bin

 cd pango-1.24.0
 CFLAGS=-DFC_WEIGHT_EXTRABLACK=215 ./configure --prefix=/usr/local
 make -j4
 sudo make install

 cd librsvg-2.26.0
 ./configure --prefix=/usr/local
 make -j4
 sudo make install

 cd gtk2hs-0.10.0
 ./configure --disable-gio
 make -j4
 sudo make install

 Running apps linked with this version of gtk2hs gets:

 (svgviewer:43314): Pango-CRITICAL **: No modules found:
 No builtin or dynamically loaded modules were found.
 PangoFc will not work correctly.
 This probably means there was an error in the creation of:
  '/usr/local/etc/pango/pango.modules'
 You should create this file by running:
  pango-querymodules  '/usr/local/etc/pango/pango.modules'

 (svgviewer:43314): 

Re: [Haskell-cafe] [GSOC] About Implementing Maps using generalized tries project idea

2009-03-21 Thread Jamie Brandon
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/gmap-0.1

Everything in the release is working. There's some fast map/trie
implementations and a bunch of map combinators. In Test.GMap there are
~800 lines of quickcheck properties. The tests use some undocumented
type hackery to allow them to run on any instance of the GMap class.
Some of the strictness invariants demanded by the test suite are not
documented.

There are no real benchmarks. I'm still not even sure how to
effectively benchmark haskell code.

If you want to suggest this as a project for 2009 I think the
priorities should be:
  Documentation + examples (which I'm willing to help with if there is interest)
  Systematic benchmarks
  Integration with the edison api, to encourage a single collection
api on hackage

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


Re: [Haskell-cafe] Data.Binary, Data.Text and errors

2009-03-21 Thread Alexander Dunlap
On Sun, Mar 15, 2009 at 9:13 PM, Bryan O'Sullivan b...@serpentine.com wrote:
 On Sun, Mar 15, 2009 at 8:40 PM, Alexander Dunlap
 alexander.dun...@gmail.com wrote:

 I have noticed that in both Data.Binary and Data.Text (which is still
 experimental, but still), the decode functions can be undefined
 (i.e. bottom) if they encounter malformed input.

 For decoding Unicode, it's typical to provide a flexible API that can do one
 of the following on a bad encoding:

 Substitute a character
 Skip it
 Return the partial decode
 Throw an exception

 I just haven't gotten there yet.


Thanks! I guess we'll see how this comes together.

Does anyone know about error handling options in Data.Binary? Are
there plans to add an error handling mechanism?

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


[Haskell-cafe] [ANN] random-stream 0.1.1

2009-03-21 Thread Manlio Perillo

I'm pleased to announce a new version of random-stream package.

In this version I have rewritten the internal API.
Now the package exposes a new System.Random.URandom module, with the 
function:


urandom :: Int - IO S.ByteString

This function is an interface to the system pseudo random numbers generator.

The API of the module System.Random.Stream is left unchanged, but it now 
uses the urandom function, internally.


System.Random.Stream provides a pure interface over urandom, using a 
lazy ByteString of random bytes.

Since it provides an infinite stream of random data, things should be ok.


I have also added support to Windows (older versions may not be 
supported, however [1]).



The package should be available on Hackage.
Mercurial repository is at:
http://hg.mperillo.ath.cx/haskell/random-stream/


Example usage: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2738


[1] It is possible to use OpenSSL, as a fallback.
Just set the HAVE_SSL flag, during package configuration.
The OpenSSL DLL should be placed where the linker can find it.
I tried to test this, but without success
(but I did not put much effort in it).



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


[Haskell-cafe] ghci + hopengl

2009-03-21 Thread Rafael Cunha de Almeida
Hello,

I'm writing a program for plotting vectorial functions and maybe
something else in the future. My goal is to be able to have the
following usage:

Prelude :l Galo.hs
Prelude Galo show3Dvec (\t - (t, t, 0)) [0.0,0.01 .. 1.0]
* shows graph *
Prelude Galo show3Dvec (\t - (t, t**2, 0)) [0.0,0.01 .. 1.0]
* shows new graph *

I already done something, the main module can be found here:


http://github.com/aflag/galo/blob/0a54a53db0f66384cfc0775f12582931d0fb4205/Galo.hs

The whole project is found here:

http://github.com/aflag/galo/tree/master

I think mainLoop is somehow responsible to exit the whole thing. I
tried to even call that function through forkIO. But didn't work quite
well: my terminal started behaving really weird after I closed the
window.

Could you explain me what is going on and what should I look into for
understanding how to solve the issue?

[]'s
Rafael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] about beta NF in lambda calculus

2009-03-21 Thread Algebras Math
hi,

What is the different between 'in beta normal form' and 'has beta normal
form' ? Does the former means the current form of the term is already in
normal form but the latter means that it is not a normal form yet and can be
reduced to be normal form? Like  \x.x is in NF and (\x.x) (\x.x) has NF?

If above is true, I am confused why we have to distinguish the terms which
have NF and be in NF? isn't the terms have NF will eventually become in NF?
or there are some way to avoid them becoming in NF?

Thanks

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


Re: [Haskell-cafe] Re: [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Manlio Perillo

Achim Schneider ha scritto:

Manlio Perillo manlio_peri...@libero.it wrote:


Do you plan to extend the package to any terminal, using terminfo
database?


Are there any non-ansi terminals left? I assumed they were extinct...
it'd come close to using EBCDIC.



http://groups.google.com/group/comp.unix.shell/browse_thread/thread/a1a088da1032f336/b3862f039688f0f8


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


Re: [Haskell-cafe] [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Manlio Perillo

Max Bolingbroke ha scritto:

2009/3/21 Manlio Perillo manlio_peri...@libero.it:

Max Bolingbroke ha scritto:

These two packages allow Haskell programs to produce much richer
console output by allowing colorisation, emboldening and so on.


Do you plan to extend the package to any terminal, using terminfo database?


Manlio,

I don't plan on an extension like this myself, as assuming ANSI
support is enough for all the applications I'm interested in, and I
suspect dealing with terminfo stuff will be a headache. Sorry!



I think, instead, that it should not be that hard.
After all the C API can be wrapper in pure functions.
And you can also write a pure Haskell interface to terminfo database.



Cheers,
Max




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


Re: [Haskell-cafe] about beta NF in lambda calculus

2009-03-21 Thread Ryan Ingram
Given the Y combinator, Y (\x.x) has no normal form.

However, (\a. (\x. x)) (Y (\x. x)) does have a normal form; (\x. x).
But it only reduces to that normal form if you reduce the (\a. ...)
redex, not if you reduce its argument.  So depending on evaluation
order you might not reach a normal form.

  -- ryan

2009/3/21 Algebras Math algebras2...@googlemail.com:
 hi,

 What is the different between 'in beta normal form' and 'has beta normal
 form' ? Does the former means the current form of the term is already in
 normal form but the latter means that it is not a normal form yet and can be
 reduced to be normal form? Like  \x.x is in NF and (\x.x) (\x.x) has NF?

 If above is true, I am confused why we have to distinguish the terms which
 have NF and be in NF? isn't the terms have NF will eventually become in NF?
 or there are some way to avoid them becoming in NF?

 Thanks

 Alg

 ___
 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] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren

(back to the list)

Answers inline:

On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:


Yes, that was the problem, and swapping the PATH order does the trick.
Thanks.


no prob.


I must still have the macports stuff installed. Can you tell me how to
get rid of it?


if you really want to get rid of it I believe you just have to rm -rf / 
opt/local and remove any initialization hooks for /opt/local out of / 
etc/profile and ~/.bash_profile



However I still can't install my program - I get missing dependencies
for gtk glib cairo and svgcairo.


I'm not really that savvy with the package registration magics -- on  
my system after doing sudo make install for gtk2hs, I get the packages  
properly registered. You can check the registered packages with ghc- 
pkg list. It could be that the package is registered local for your  
user, but the cabal install line you're using for the application  
includes --global (or your cabal configuration) so it won't look in  
the user config.


I think Duncan answered some questions about this same problem  
recently, though I don't have a mailing list reference.



I tried some of the gtk2hs demos - they work, but, for instance, the
actionmenu demo does not put the menus up at the top of the screen, so
it doesn't look like the framework integration has worked.


Even with the integration everything is still GTK-ish. There's a  
separate framework that comes with the .dmg called ige-mac-integration  
that allows applications to meld with the mac environment better, but  
no gtk2hs bindings for this exist at the moment. Bindings would have  
to be created, and then you'd have to modify the application to make  
use of them (presumably with CPP or similar switch to control whether  
you want mac support, or just plain GTK)


-Ross


2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
I think there must be a version inconsistency with your GLib  
framework --
either not the most recent copy of the GTK+ DMG, or your path is  
flipped

around and you're using a ports version.

Run glib-mkenums --version to see what version you have... I have

r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
 --version
glib-mkenums version glib-2.18.1
glib-mkenums comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of glib-mkenums under the terms of
the GNU General Public License which can be found in the
GLib source package. Sources, examples and contact
information are available at http://www.gtk.org

Particularly, the error you're getting is because your version of
glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums  
with no

arguments, my version reports @ENUMPREFIX@ as a valid subtitution:

r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
Usage: glib-mkenums [options] [files...]
 --fhead text output file header
 --fprod text per input file production
 --ftail text output file trailer
 --eprod text per enum text (produced prior to value
itarations)
 --vhead text value header, produced before iterating  
over

enum values
 --vprod text value text, produced for each enum value
 --vtail text value tail, produced after iterating  
over enum

values
 --comments text  comment structure
 --template filetemplate file
 -h, --help show this help message
 -v, --version  print version informations
Production text substitutions:
 @EnumName@ PrefixTheXEnum
 @enum_name@prefix_the_xenum
 @ENUMNAME@ PREFIX_THE_XENUM
 @ENUMSHORT@THE_XENUM
 @ENUMPREFIX@   PREFIX
 @VALUENAME@PREFIX_THE_XVALUE
 @valuenick@the-xvalue
 @type@ either enum or flags
 @Type@ either Enum or Flags
 @TYPE@ either ENUM or FLAGS
 @filename@ name of current input file


Does yours?

You might try moving /Library/Frameworks/GLib.framework/Resources/ 
dev/bin to

the front of your path before make'ing pango --

cd pango-1.24.0
export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin: 
$PATH

make

Hope this helps,

-Ross

On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:


Attached.



2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:


(taking this off list, to avoid noise)

Could you attach pango-1.24.0/pango/pango-enum-types.h? Something  
hokey

is
going on -- this file is shipped with pango-1.24.0 but may be  
overwritten

if
your glib-mkenums does it differently. In any case, since it's  
(possibly)
machine generated I would have to see what's going on at those  
lines to

make
progress.

Also, if you could cd pango-1.24.0/pango, and run:

gcc -E -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\Pango\
-DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE
-DSYSCONFDIR=\/usr/local/etc\
-DLIBDIR=\/usr/local/lib\ -I.. -DG_DISABLE_CAST_CHECKS
-I/Library/Frameworks/GLib.framework/Headers
 

Re: [Haskell-cafe] about beta NF in lambda calculus

2009-03-21 Thread Eugene Kirpichov
Thus, if you use normal-order evaluation (which Haskell uses), you
will inevitably reach the normal form if and only if it exists at all.
So, if all you care about is the normal form (if you don't care about
computation time), then terms that *have* an NF and terms that *are*
in NF are indistinguishable for you in Haskell.

2009/3/21 Ryan Ingram ryani.s...@gmail.com:
 Given the Y combinator, Y (\x.x) has no normal form.

 However, (\a. (\x. x)) (Y (\x. x)) does have a normal form; (\x. x).
 But it only reduces to that normal form if you reduce the (\a. ...)
 redex, not if you reduce its argument.  So depending on evaluation
 order you might not reach a normal form.

  -- ryan

 2009/3/21 Algebras Math algebras2...@googlemail.com:
 hi,

 What is the different between 'in beta normal form' and 'has beta normal
 form' ? Does the former means the current form of the term is already in
 normal form but the latter means that it is not a normal form yet and can be
 reduced to be normal form? Like  \x.x is in NF and (\x.x) (\x.x) has NF?

 If above is true, I am confused why we have to distinguish the terms which
 have NF and be in NF? isn't the terms have NF will eventually become in NF?
 or there are some way to avoid them becoming in NF?

 Thanks

 Alg

 ___
 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




-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] about beta NF in lambda calculus

2009-03-21 Thread Antti-Juhani Kaijanaho
On Sat, Mar 21, 2009 at 07:29:05PM +, Algebras Math wrote:
 If above is true, I am confused why we have to distinguish the terms which
 have NF and be in NF? isn't the terms have NF will eventually become in NF?
 or there are some way to avoid them becoming in NF?

Spoken like a mathematician :)  (Well, only sort of.)

The way to avoid it is not to perform the work of beta conversion.
Similarly, you may say that people are either dead or will eventually die, so
why distinguish between a person who is dead and a mortal, live person?

-- 
Antti-Juhani Kaijanaho, Jyväskylä, Finland
http://antti-juhani.kaijanaho.fi/newblog/
http://www.flickr.com/photos/antti-juhani/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANNOUNCE: Haddock 2.4.2

2009-03-21 Thread David Waern

-- Haddock 2.4.2


A new version of Haddock, the Haskell documentation tool, is out.

This is a bug fix release only, and it's the same version that will ship with
GHC 6.10.2, unless any important problems are discovered before the GHC
release.

Because the .haddock file format has changed, links to previously installed
documentation will not work when generating documentation using this version.

Please use the bug tracker to submit bug reports or feature requests.


-- Changes in version 2.4.2


  * Support for GHC 6.10.2

  * Haddock no longer crashes on Template Haskell modules (#68)
(only with GHC 6.10.2 or above)

  * Fix problem with Template Haskell-generated declarations disappearing (#59)

  * Generate two anchors for each link for compatibility between IE and Opera
(#45)

  * Improved error messages

  * Show re-exports from external packages again (GHC ticket #2746)

  * Store hidden modules in .haddock files again (needed by the haddock
library)

  * Avoid processing boot modules

  * Pragmas may exist between document comments and declarations

  * Do not indicate that a constructor argument is unboxed

  * Fix problem with non-working links to ghc-prim

  * Allow referring to a specific section within a module in a module link
(#65)

  * Fixes to the Hoogle backend

  * Improvements to the haddock library

  * Many other fixes (including #67, #69, #58, #57)


-- Links


Homepage:
 http://www.haskell.org/haddock

Hackage page:
 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haddock-2.4.2

Bugtracker and wiki:
 http://trac.haskell.org/haddock

Mailing list:
 hadd...@projects.haskell.org

Code repository:
 http://code.haskell.org/haddock


-- Contributors


The following people contributed patches to this release:

 Joachim Breitner
 Roman Cheplyaka
 Ian Lynagh
 Neil Mitchell
 Simon Peyton-Jones
 Thomas Schilling
 David Waern


-- Get Involved


We welcome new contributors. To get involved, start by grabbing the code:

 http://code.haskell.org/haddock

Then take a look at the bug and feature tracker for things to work on:

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


Re: [Haskell-cafe] about beta NF in lambda calculus

2009-03-21 Thread Eugene Kirpichov
Actually I was also going to provide exactly the same example, but
hesitated to :)

2009/3/21 Antti-Juhani Kaijanaho antti-juh...@kaijanaho.fi:
 On Sat, Mar 21, 2009 at 07:29:05PM +, Algebras Math wrote:
 If above is true, I am confused why we have to distinguish the terms which
 have NF and be in NF? isn't the terms have NF will eventually become in NF?
 or there are some way to avoid them becoming in NF?

 Spoken like a mathematician :)  (Well, only sort of.)

 The way to avoid it is not to perform the work of beta conversion.
 Similarly, you may say that people are either dead or will eventually die, so
 why distinguish between a person who is dead and a mortal, live person?

 --
 Antti-Juhani Kaijanaho, Jyväskylä, Finland
 http://antti-juhani.kaijanaho.fi/newblog/
 http://www.flickr.com/photos/antti-juhani/
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Colin Adams
OK - I added the --with-user-pkginfo flag.
It nearly all works now - but still no svgcairo - ./configure doesn't find it.

2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
 (back to the list)

 Answers inline:

 On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:

 Yes, that was the problem, and swapping the PATH order does the trick.
 Thanks.

 no prob.

 I must still have the macports stuff installed. Can you tell me how to
 get rid of it?

 if you really want to get rid of it I believe you just have to rm -rf
 /opt/local and remove any initialization hooks for /opt/local out of
 /etc/profile and ~/.bash_profile

 However I still can't install my program - I get missing dependencies
 for gtk glib cairo and svgcairo.

 I'm not really that savvy with the package registration magics -- on my
 system after doing sudo make install for gtk2hs, I get the packages properly
 registered. You can check the registered packages with ghc-pkg list. It
 could be that the package is registered local for your user, but the cabal
 install line you're using for the application includes --global (or your
 cabal configuration) so it won't look in the user config.

 I think Duncan answered some questions about this same problem recently,
 though I don't have a mailing list reference.

 I tried some of the gtk2hs demos - they work, but, for instance, the
 actionmenu demo does not put the menus up at the top of the screen, so
 it doesn't look like the framework integration has worked.

 Even with the integration everything is still GTK-ish. There's a separate
 framework that comes with the .dmg called ige-mac-integration that allows
 applications to meld with the mac environment better, but no gtk2hs bindings
 for this exist at the moment. Bindings would have to be created, and then
 you'd have to modify the application to make use of them (presumably with
 CPP or similar switch to control whether you want mac support, or just plain
 GTK)

 -Ross

 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 I think there must be a version inconsistency with your GLib framework --
 either not the most recent copy of the GTK+ DMG, or your path is flipped
 around and you're using a ports version.

 Run glib-mkenums --version to see what version you have... I have

 r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
  --version
 glib-mkenums version glib-2.18.1
 glib-mkenums comes with ABSOLUTELY NO WARRANTY.
 You may redistribute copies of glib-mkenums under the terms of
 the GNU General Public License which can be found in the
 GLib source package. Sources, examples and contact
 information are available at http://www.gtk.org

 Particularly, the error you're getting is because your version of
 glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with no
 arguments, my version reports @ENUMPREFIX@ as a valid subtitution:

 r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
 Usage: glib-mkenums [options] [files...]
  --fhead text             output file header
  --fprod text             per input file production
  --ftail text             output file trailer
  --eprod text             per enum text (produced prior to value
 itarations)
  --vhead text             value header, produced before iterating over
 enum values
  --vprod text             value text, produced for each enum value
  --vtail text             value tail, produced after iterating over
 enum
 values
  --comments text          comment structure
  --template file            template file
  -h, --help                 show this help message
  -v, --version              print version informations
 Production text substitutions:
 �...@enumname@                 PrefixTheXEnum
 �...@enum_name@                prefix_the_xenum
 �...@enumname@                 PREFIX_THE_XENUM
 �...@enumshort@                THE_XENUM
 �...@enumprefix@               PREFIX
 �...@valuename@                PREFIX_THE_XVALUE
 �...@valuenick@                the-xvalue
 �...@type@                     either enum or flags
 �...@type@                     either Enum or Flags
 �...@type@                     either ENUM or FLAGS
 �...@filename@                 name of current input file


 Does yours?

 You might try moving /Library/Frameworks/GLib.framework/Resources/dev/bin
 to
 the front of your path before make'ing pango --

 cd pango-1.24.0
 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin:$PATH
 make

 Hope this helps,

 -Ross

 On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:

 Attached.



 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 (taking this off list, to avoid noise)

 Could you attach pango-1.24.0/pango/pango-enum-types.h? Something hokey
 is
 going on -- this file is shipped with pango-1.24.0 but may be
 overwritten
 if
 your glib-mkenums does it differently. In any case, since it's
 (possibly)
 machine generated I would have to see what's going on at those lines to
 make
 progress.

 Also, if you could cd pango-1.24.0/pango, and run:

 gcc 

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
Did the configure for gtk2hs claim that it was going to build  
svgcairo? If something is wrong with the librsvg install, it won't.


-Ross

On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:


OK - I added the --with-user-pkginfo flag.
It nearly all works now - but still no svgcairo - ./configure  
doesn't find it.


2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

(back to the list)

Answers inline:

On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:

Yes, that was the problem, and swapping the PATH order does the  
trick.

Thanks.


no prob.

I must still have the macports stuff installed. Can you tell me  
how to

get rid of it?


if you really want to get rid of it I believe you just have to rm -rf
/opt/local and remove any initialization hooks for /opt/local out of
/etc/profile and ~/.bash_profile

However I still can't install my program - I get missing  
dependencies

for gtk glib cairo and svgcairo.


I'm not really that savvy with the package registration magics --  
on my
system after doing sudo make install for gtk2hs, I get the packages  
properly
registered. You can check the registered packages with ghc-pkg  
list. It
could be that the package is registered local for your user, but  
the cabal
install line you're using for the application includes --global (or  
your

cabal configuration) so it won't look in the user config.

I think Duncan answered some questions about this same problem  
recently,

though I don't have a mailing list reference.


I tried some of the gtk2hs demos - they work, but, for instance, the
actionmenu demo does not put the menus up at the top of the  
screen, so

it doesn't look like the framework integration has worked.


Even with the integration everything is still GTK-ish. There's a  
separate
framework that comes with the .dmg called ige-mac-integration that  
allows
applications to meld with the mac environment better, but no gtk2hs  
bindings
for this exist at the moment. Bindings would have to be created,  
and then
you'd have to modify the application to make use of them  
(presumably with
CPP or similar switch to control whether you want mac support, or  
just plain

GTK)

-Ross


2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:


I think there must be a version inconsistency with your GLib  
framework --
either not the most recent copy of the GTK+ DMG, or your path is  
flipped

around and you're using a ports version.

Run glib-mkenums --version to see what version you have... I have

r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
 --version
glib-mkenums version glib-2.18.1
glib-mkenums comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of glib-mkenums under the terms of
the GNU General Public License which can be found in the
GLib source package. Sources, examples and contact
information are available at http://www.gtk.org

Particularly, the error you're getting is because your version of
glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums  
with no

arguments, my version reports @ENUMPREFIX@ as a valid subtitution:

r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
Usage: glib-mkenums [options] [files...]
 --fhead text output file header
 --fprod text per input file production
 --ftail text output file trailer
 --eprod text per enum text (produced prior to value
itarations)
 --vhead text value header, produced before  
iterating over

enum values
 --vprod text value text, produced for each enum  
value
 --vtail text value tail, produced after iterating  
over

enum
values
 --comments text  comment structure
 --template filetemplate file
 -h, --help show this help message
 -v, --version  print version informations
Production text substitutions:
 @EnumName@ PrefixTheXEnum
 @enum_name@prefix_the_xenum
 @ENUMNAME@ PREFIX_THE_XENUM
 @ENUMSHORT@THE_XENUM
 @ENUMPREFIX@   PREFIX
 @VALUENAME@PREFIX_THE_XVALUE
 @valuenick@the-xvalue
 @type@ either enum or flags
 @Type@ either Enum or Flags
 @TYPE@ either ENUM or FLAGS
 @filename@ name of current input file


Does yours?

You might try moving /Library/Frameworks/GLib.framework/Resources/ 
dev/bin

to
the front of your path before make'ing pango --

cd pango-1.24.0
export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin: 
$PATH

make

Hope this helps,

-Ross

On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:


Attached.



2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:


(taking this off list, to avoid noise)

Could you attach pango-1.24.0/pango/pango-enum-types.h?  
Something hokey

is
going on -- this file is shipped with pango-1.24.0 but may be
overwritten
if
your glib-mkenums does it differently. In any case, since it's
(possibly)
machine 

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Colin Adams
It didn't.

2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
 Did the configure for gtk2hs claim that it was going to build svgcairo? If
 something is wrong with the librsvg install, it won't.

 -Ross

 On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:

 OK - I added the --with-user-pkginfo flag.
 It nearly all works now - but still no svgcairo - ./configure doesn't find
 it.

 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 (back to the list)

 Answers inline:

 On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:

 Yes, that was the problem, and swapping the PATH order does the trick.
 Thanks.

 no prob.

 I must still have the macports stuff installed. Can you tell me how to
 get rid of it?

 if you really want to get rid of it I believe you just have to rm -rf
 /opt/local and remove any initialization hooks for /opt/local out of
 /etc/profile and ~/.bash_profile

 However I still can't install my program - I get missing dependencies
 for gtk glib cairo and svgcairo.

 I'm not really that savvy with the package registration magics -- on my
 system after doing sudo make install for gtk2hs, I get the packages
 properly
 registered. You can check the registered packages with ghc-pkg list. It
 could be that the package is registered local for your user, but the
 cabal
 install line you're using for the application includes --global (or your
 cabal configuration) so it won't look in the user config.

 I think Duncan answered some questions about this same problem recently,
 though I don't have a mailing list reference.

 I tried some of the gtk2hs demos - they work, but, for instance, the
 actionmenu demo does not put the menus up at the top of the screen, so
 it doesn't look like the framework integration has worked.

 Even with the integration everything is still GTK-ish. There's a separate
 framework that comes with the .dmg called ige-mac-integration that allows
 applications to meld with the mac environment better, but no gtk2hs
 bindings
 for this exist at the moment. Bindings would have to be created, and then
 you'd have to modify the application to make use of them (presumably with
 CPP or similar switch to control whether you want mac support, or just
 plain
 GTK)

 -Ross

 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 I think there must be a version inconsistency with your GLib framework
 --
 either not the most recent copy of the GTK+ DMG, or your path is
 flipped
 around and you're using a ports version.

 Run glib-mkenums --version to see what version you have... I have

 r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
  --version
 glib-mkenums version glib-2.18.1
 glib-mkenums comes with ABSOLUTELY NO WARRANTY.
 You may redistribute copies of glib-mkenums under the terms of
 the GNU General Public License which can be found in the
 GLib source package. Sources, examples and contact
 information are available at http://www.gtk.org

 Particularly, the error you're getting is because your version of
 glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with
 no
 arguments, my version reports @ENUMPREFIX@ as a valid subtitution:

 r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
 Usage: glib-mkenums [options] [files...]
  --fhead text             output file header
  --fprod text             per input file production
  --ftail text             output file trailer
  --eprod text             per enum text (produced prior to value
 itarations)
  --vhead text             value header, produced before iterating
 over
 enum values
  --vprod text             value text, produced for each enum value
  --vtail text             value tail, produced after iterating over
 enum
 values
  --comments text          comment structure
  --template file            template file
  -h, --help                 show this help message
  -v, --version              print version informations
 Production text substitutions:
 �...@enumname@                 PrefixTheXEnum
 �...@enum_name@                prefix_the_xenum
 �...@enumname@                 PREFIX_THE_XENUM
 �...@enumshort@                THE_XENUM
 �...@enumprefix@               PREFIX
 �...@valuename@                PREFIX_THE_XVALUE
 �...@valuenick@                the-xvalue
 �...@type@                     either enum or flags
 �...@type@                     either Enum or Flags
 �...@type@                     either ENUM or FLAGS
 �...@filename@                 name of current input file


 Does yours?

 You might try moving
 /Library/Frameworks/GLib.framework/Resources/dev/bin
 to
 the front of your path before make'ing pango --

 cd pango-1.24.0
 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin:$PATH
 make

 Hope this helps,

 -Ross

 On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:

 Attached.



 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 (taking this off list, to avoid noise)

 Could you attach pango-1.24.0/pango/pango-enum-types.h? Something
 hokey
 is
 going on -- this file is shipped with 

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Colin Adams
And the reason is that librsvg fails to find cairo,  pangocairo and cairo-png.

Where is it supposed to find them?

2009/3/21 Colin Adams colinpaulad...@googlemail.com:
 It didn't.

 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
 Did the configure for gtk2hs claim that it was going to build svgcairo? If
 something is wrong with the librsvg install, it won't.

 -Ross

 On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:

 OK - I added the --with-user-pkginfo flag.
 It nearly all works now - but still no svgcairo - ./configure doesn't find
 it.

 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 (back to the list)

 Answers inline:

 On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:

 Yes, that was the problem, and swapping the PATH order does the trick.
 Thanks.

 no prob.

 I must still have the macports stuff installed. Can you tell me how to
 get rid of it?

 if you really want to get rid of it I believe you just have to rm -rf
 /opt/local and remove any initialization hooks for /opt/local out of
 /etc/profile and ~/.bash_profile

 However I still can't install my program - I get missing dependencies
 for gtk glib cairo and svgcairo.

 I'm not really that savvy with the package registration magics -- on my
 system after doing sudo make install for gtk2hs, I get the packages
 properly
 registered. You can check the registered packages with ghc-pkg list. It
 could be that the package is registered local for your user, but the
 cabal
 install line you're using for the application includes --global (or your
 cabal configuration) so it won't look in the user config.

 I think Duncan answered some questions about this same problem recently,
 though I don't have a mailing list reference.

 I tried some of the gtk2hs demos - they work, but, for instance, the
 actionmenu demo does not put the menus up at the top of the screen, so
 it doesn't look like the framework integration has worked.

 Even with the integration everything is still GTK-ish. There's a separate
 framework that comes with the .dmg called ige-mac-integration that allows
 applications to meld with the mac environment better, but no gtk2hs
 bindings
 for this exist at the moment. Bindings would have to be created, and then
 you'd have to modify the application to make use of them (presumably with
 CPP or similar switch to control whether you want mac support, or just
 plain
 GTK)

 -Ross

 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:

 I think there must be a version inconsistency with your GLib framework
 --
 either not the most recent copy of the GTK+ DMG, or your path is
 flipped
 around and you're using a ports version.

 Run glib-mkenums --version to see what version you have... I have

 r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
  --version
 glib-mkenums version glib-2.18.1
 glib-mkenums comes with ABSOLUTELY NO WARRANTY.
 You may redistribute copies of glib-mkenums under the terms of
 the GNU General Public License which can be found in the
 GLib source package. Sources, examples and contact
 information are available at http://www.gtk.org

 Particularly, the error you're getting is because your version of
 glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib-mkenums with
 no
 arguments, my version reports @ENUMPREFIX@ as a valid subtitution:

 r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib-mkenums
 Usage: glib-mkenums [options] [files...]
  --fhead text             output file header
  --fprod text             per input file production
  --ftail text             output file trailer
  --eprod text             per enum text (produced prior to value
 itarations)
  --vhead text             value header, produced before iterating
 over
 enum values
  --vprod text             value text, produced for each enum value
  --vtail text             value tail, produced after iterating over
 enum
 values
  --comments text          comment structure
  --template file            template file
  -h, --help                 show this help message
  -v, --version              print version informations
 Production text substitutions:
 �...@enumname@                 PrefixTheXEnum
 �...@enum_name@                prefix_the_xenum
 �...@enumname@                 PREFIX_THE_XENUM
 �...@enumshort@                THE_XENUM
 �...@enumprefix@               PREFIX
 �...@valuename@                PREFIX_THE_XVALUE
 �...@valuenick@                the-xvalue
 �...@type@                     either enum or flags
 �...@type@                     either Enum or Flags
 �...@type@                     either ENUM or FLAGS
 �...@filename@                 name of current input file


 Does yours?

 You might try moving
 /Library/Frameworks/GLib.framework/Resources/dev/bin
 to
 the front of your path before make'ing pango --

 cd pango-1.24.0
 export PATH=/Library/Frameworks/GLib.framework/Resources/dev/bin:$PATH
 make

 Hope this helps,

 -Ross

 On Mar 21, 2009, at 1:52 PM, Colin Adams wrote:

 Attached.



 2009/3/21 Ross Mellgren 

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
Should be from pkg-config path, make sure your PKG_CONFIG_PATH is set  
to include /Library/Frameworks/{GLib,Gtk,Cairo}.framework


Also, I had a problem where it couldn't find libpng -- I had to add / 
usr/X11/lib/pkgconfig to my pkg-config path.


-Ross

On Mar 21, 2009, at 5:02 PM, Colin Adams wrote:

And the reason is that librsvg fails to find cairo,  pangocairo and  
cairo-png.


Where is it supposed to find them?

2009/3/21 Colin Adams colinpaulad...@googlemail.com:

It didn't.

2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:
Did the configure for gtk2hs claim that it was going to build  
svgcairo? If

something is wrong with the librsvg install, it won't.

-Ross

On Mar 21, 2009, at 4:49 PM, Colin Adams wrote:


OK - I added the --with-user-pkginfo flag.
It nearly all works now - but still no svgcairo - ./configure  
doesn't find

it.

2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:


(back to the list)

Answers inline:

On Mar 21, 2009, at 2:42 PM, Colin Adams wrote:

Yes, that was the problem, and swapping the PATH order does the  
trick.

Thanks.


no prob.

I must still have the macports stuff installed. Can you tell me  
how to

get rid of it?


if you really want to get rid of it I believe you just have to  
rm -rf
/opt/local and remove any initialization hooks for /opt/local  
out of

/etc/profile and ~/.bash_profile

However I still can't install my program - I get missing  
dependencies

for gtk glib cairo and svgcairo.


I'm not really that savvy with the package registration magics  
-- on my
system after doing sudo make install for gtk2hs, I get the  
packages

properly
registered. You can check the registered packages with ghc-pkg  
list. It
could be that the package is registered local for your user, but  
the

cabal
install line you're using for the application includes --global  
(or your

cabal configuration) so it won't look in the user config.

I think Duncan answered some questions about this same problem  
recently,

though I don't have a mailing list reference.

I tried some of the gtk2hs demos - they work, but, for  
instance, the
actionmenu demo does not put the menus up at the top of the  
screen, so

it doesn't look like the framework integration has worked.


Even with the integration everything is still GTK-ish. There's a  
separate
framework that comes with the .dmg called ige-mac-integration  
that allows
applications to meld with the mac environment better, but no  
gtk2hs

bindings
for this exist at the moment. Bindings would have to be created,  
and then
you'd have to modify the application to make use of them  
(presumably with
CPP or similar switch to control whether you want mac support,  
or just

plain
GTK)

-Ross


2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac:


I think there must be a version inconsistency with your GLib  
framework

--
either not the most recent copy of the GTK+ DMG, or your path is
flipped
around and you're using a ports version.

Run glib-mkenums --version to see what version you have... I  
have


r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib- 
mkenums

 --version
glib-mkenums version glib-2.18.1
glib-mkenums comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of glib-mkenums under the terms of
the GNU General Public License which can be found in the
GLib source package. Sources, examples and contact
information are available at http://www.gtk.org

Particularly, the error you're getting is because your version  
of
glib-mkenums doesn't expand @ENUMPREFIX@ -- if I run glib- 
mkenums with

no
arguments, my version reports @ENUMPREFIX@ as a valid  
subtitution:


r...@hugo:~/tmpgtk/GLib.framework/Resources/dev/bin$ ./glib- 
mkenums

Usage: glib-mkenums [options] [files...]
 --fhead text output file header
 --fprod text per input file production
 --ftail text output file trailer
 --eprod text per enum text (produced prior to  
value

itarations)
 --vhead text value header, produced before  
iterating

over
enum values
 --vprod text value text, produced for each enum  
value
 --vtail text value tail, produced after  
iterating over

enum
values
 --comments text  comment structure
 --template filetemplate file
 -h, --help show this help message
 -v, --version  print version informations
Production text substitutions:
 @EnumName@ PrefixTheXEnum
 @enum_name@prefix_the_xenum
 @ENUMNAME@ PREFIX_THE_XENUM
 @ENUMSHORT@THE_XENUM
 @ENUMPREFIX@   PREFIX
 @VALUENAME@PREFIX_THE_XVALUE
 @valuenick@the-xvalue
 @type@ either enum or flags
 @Type@ either Enum or Flags
 @TYPE@ either ENUM or FLAGS
 @filename@ name of current input file


Does yours?

You might try moving
/Library/Frameworks/GLib.framework/Resources/dev/bin
to

[Haskell-cafe] Re: Ease of Haskell development on OS X?

2009-03-21 Thread Achim Schneider
Ross Mellgren rmm-hask...@z.odi.ac wrote:

 

Way too many, definitely.

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.


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


Re: [Haskell-cafe] Re: Haskell Logo write-in candidate

2009-03-21 Thread Ketil Malde
Achim Schneider bars...@web.de writes:

 :: might be truly Haskell in the sense that everybody else uses
 plain :, but I don't want Haskell to be associated with squareness, and
 typing, by itself, is hardly a distinguishing property of Haskell.

I guess laziness is the most distinguishing property, and there's no
symbol associated with that.  How about having no logo, symbolizing
laziness?  It somehow feels oddly appropriate...

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ghci + hopengl

2009-03-21 Thread Duane Johnson
I've had issues with ghci and opengl... I usually have to compile my  
programs before they will run.  I'm not sure why that's the case, but  
I too get strange window behavior (sometimes it freezes, other times  
it doesn't even show up).


If you're on a Mac and would like help compiling to a .app folder, let  
me know and I can post how I did that.


Regards,
Duane Johnson
http://blog.inquirylabs.com/

On Mar 21, 2009, at 1:27 PM, Rafael Cunha de Almeida wrote:


Hello,

I'm writing a program for plotting vectorial functions and maybe
something else in the future. My goal is to be able to have the
following usage:

Prelude :l Galo.hs
Prelude Galo show3Dvec (\t - (t, t, 0)) [0.0,0.01 .. 1.0]
* shows graph *
Prelude Galo show3Dvec (\t - (t, t**2, 0)) [0.0,0.01 .. 1.0]
* shows new graph *

I already done something, the main module can be found here:


http://github.com/aflag/galo/blob/0a54a53db0f66384cfc0775f12582931d0fb4205/Galo.hs

The whole project is found here:

http://github.com/aflag/galo/tree/master

I think mainLoop is somehow responsible to exit the whole thing. I
tried to even call that function through forkIO. But didn't work quite
well: my terminal started behaving really weird after I closed the
window.

Could you explain me what is going on and what should I look into for
understanding how to solve the issue?

[]'s
Rafael
___
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] Cabal properties with conditionals

2009-03-21 Thread Duncan Coutts
On Sat, 2009-03-21 at 14:26 +0100, Manlio Perillo wrote:
 Hi.
 
 Assuming this configuration fragment:
 
 library xxx
  cc-options: -Wall
 
  if flag(HAVE_URANDOM)
  cc-options:-DHAVE_URANDOM
 
 In case the HAVE_URANDOM flag is defined, what will be the value of the 
 used cc-options?
 1) -DHAHE_URANDOM
 2) -Wall -DHAHE_URANDOM

The latter. Try it.

In general all fields get `mappend`ed which for list-like fields means
appending. For single value fields like True/False then latter fields
win.

Duncan

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


Re: [Haskell-cafe] [ANN] Safe Lazy IO in Haskell

2009-03-21 Thread Henning Thielemann


On Fri, 20 Mar 2009, Nicolas Pouillard wrote:


Hi folks,

We have good news (nevertheless we hope) for all the lazy guys standing there.
Since their birth, lazy IOs have been a great way to modularly leverage all the
good things we have with *pure*, *lazy*, *Haskell* functions to the real world
of files.


Maybe you know of my packages lazy-io and explicit-exception which also 
aim at lazy I/O and asynchronous exception handling. With lazy-io, you are 
able to write more complicated things than getContents. I needed this for 
HTTP communication that is run by demand. That is when the HTTP response 
header is requested, then the function could send a HTTP request first. Is 
it possible and sensible to combine this with safe-lazy-io?


http://hackage.haskell.org/cgi-bin/hackage-scripts/package/lazyio
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/explicit-exception

I have also code that demonstrates the usage of explicit asynchronous 
exceptions. I have however still not a set of combinators that makes 
working with asynchronous exceptions as simple as working with synchronous 
ones:

 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/spreadsheet
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] New Cabal FAQ

2009-03-21 Thread Duncan Coutts
Hi all,

I should have done this ages ago but there's now a Cabal FAQ on the
Cabal website:

http://haskell.org/cabal/FAQ.html

It's not linked in yet, I'm looking for feedback and patches. The Cabal
website is now maintained in darcs so it's easy to send in
contributions:

darcs get http://haskell.org/cabal/

For new pages like the FAQ I've been using markdown via pandoc. If
appropriate we can migrate old pages to use that too.

The main Cabal home page needs some love. We should have the
cabal-install download directly on the front page. We should have quick
intro tutorials for using the cabal command line program to install
packages. There's lots of good material in the user guide but it is not
well sign-posted.

Duncan

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


Re: [Haskell-cafe] Re: Haskell Logo write-in candidate

2009-03-21 Thread Henning Thielemann


On Fri, 20 Mar 2009, Jon Fairbairn wrote:


::Haskell


See the lamp in logo 33 at
  http://www.haskell.org/logos/poll.html
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Manlio Perillo

Duncan Coutts ha scritto:

On Sat, 2009-03-21 at 14:26 +0100, Manlio Perillo wrote:

Hi.

Assuming this configuration fragment:

library xxx
 cc-options: -Wall

 if flag(HAVE_URANDOM)
 cc-options:-DHAVE_URANDOM

In case the HAVE_URANDOM flag is defined, what will be the value of the 
used cc-options?

1) -DHAHE_URANDOM
2) -Wall -DHAHE_URANDOM


The latter. Try it.

In general all fields get `mappend`ed which for list-like fields means
appending. For single value fields like True/False then latter fields
win.



Ok, thanks.


P.S: I tried to send an email to cabal-devel some days ago, with a 
feature I would like to see in Cabal.

But the mail was never posted to the mailing list.
Is that list moderated?
Should I simply fill a ticket?



Duncan




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


Re: [Haskell-cafe] New Cabal FAQ

2009-03-21 Thread Duane Johnson
As a new Haskell user, I have to heartily agree about the sign-posts.   
Cabal is a superb, easy-to-use command-line tool for Haskell package  
management, but browsing various getting started with Haskell pages  
didn't lead me to clear instructions that cabal exists and that it is  
really important to install.


In addition, may I suggest that the very first thing under Quick Links  
at http://haskell.org/cabal/ should be the following:


Get Cabal

Currently, the first link is How to install a Cabal package which  
was quite confusing for me as a new user, since I knew I wanted the  
cabal command on my system and that getting it is a prerequisite to  
installing cabal packages.


Next, in a round-about manner, the link sends the user to http://haskell.org/haskellwiki/Cabal/How_to_install_a_Cabal_package 
 which is fairly dense reading considering that the user is just  
trying to get cabal.  At the bottom of the third paragraph of that  
page, it links to http://haskell.org/haskellwiki/Cabal-Install.  The  
Cabal-Install page itself provides an introduction paragraph stating  
that there exists a caball-install package which sounds enticing--- 
but wait, is it a package?  Doesn't that mean I need cabal to install  
cabal-install?  What's going on here


Strangely, the Usage section is listed before the Installation  
section which further confounded me until I read everything carefully.


So in retrospect, I would have very much appreciated something like  
this (my blog entry to future Haskellers).  Perhaps we could create  
the Get Cabal page and split it down the middle, one side for  
Windows and one side for Mac OS X / Linux / Unix.  It should be very  
minimal and have all of the necessary steps first with commentary  
later in case things go wrong or the visitor decides to return for  
details.


It also might be a good idea to use the cabal-specific pages on the  
wiki to redirect the user to the official cabal page where the  
official instructions reside since they show up in Google searches


Duane Johnson
http://blog.inquirylabs.com/

On Mar 21, 2009, at 3:44 PM, Duncan Coutts wrote:


Hi all,

I should have done this ages ago but there's now a Cabal FAQ on the
Cabal website:

http://haskell.org/cabal/FAQ.html

It's not linked in yet, I'm looking for feedback and patches. The  
Cabal

website is now maintained in darcs so it's easy to send in
contributions:

darcs get http://haskell.org/cabal/

For new pages like the FAQ I've been using markdown via pandoc. If
appropriate we can migrate old pages to use that too.

The main Cabal home page needs some love. We should have the
cabal-install download directly on the front page. We should have  
quick

intro tutorials for using the cabal command line program to install
packages. There's lots of good material in the user guide but it is  
not

well sign-posted.

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


[Haskell-cafe] Google Summer of Code: Is this idea useful for the community?

2009-03-21 Thread fallintothis
I'm planning on applying for the Google Summer of Code and the more I
think about it, the more excited I am over a Haskell reddit-alike[1].
I'm interested in web programming, Haskell, and reddit (being an
addict for some years now).  There's plenty of work to be done on such
a project, there are existing code bases to help along with ideas, and
it doesn't require the deepest knowledge of Haskell or, say, GHC's
guts (not that I don't find those interesting, I'm just no expert).
The hang-up I see is that there's not too much of an immediate
community benefit if reddit already exists (which, I have on good
authority, it does), other than in the interest of eating (or
customizing) your own dog food.  Any members of the Haskell community
(more involved than I am) care to comment?  Would the project be
useful or otherwise good as a Summer of Code idea?

If people don't get too sick of my pestering, I'm also considering
opening it up as a ticket on the trac to see if it gets feedback
there.

Thanks!

[1] 
http://www.reddit.com/r/haskell_proposals/comments/7u48x/a_simple_redditlike_happsbased_proposal_voting/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Duncan Coutts
On Sat, 2009-03-21 at 23:05 +0100, Manlio Perillo wrote:

 P.S: I tried to send an email to cabal-devel some days ago, with a 
 feature I would like to see in Cabal.
 But the mail was never posted to the mailing list.
 Is that list moderated?

It's subscriber only, like all the haskell.org mailing lists. We got too
much spam otherwise. :-(

 Should I simply fill a ticket?

Yes, thanks very much.

Duncan

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


Re: [Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Manlio Perillo

Duncan Coutts ha scritto:

On Sat, 2009-03-21 at 23:05 +0100, Manlio Perillo wrote:

P.S: I tried to send an email to cabal-devel some days ago, with a 
feature I would like to see in Cabal.

But the mail was never posted to the mailing list.
Is that list moderated?


It's subscriber only, like all the haskell.org mailing lists. We got too
much spam otherwise. :-(



But I did subscribed!


Should I simply fill a ticket?


Yes, thanks very much.



Ok.

I posted some details in this thread:
http://www.haskell.org/pipermail/haskell-cafe/2009-March/057923.html


Duncan




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


[Haskell-cafe] Sometimes I wish there was a global variable

2009-03-21 Thread Rafael Cunha de Almeida
Hello,

I am writing a OpenGL program in haskell, it can be found in:
http://github.com/aflag/galo/tree/master
But I hope this e-mail will be self-contained :).

My main function goes like this:
(...)
rotX - newIORef (0.0::GLfloat)
rotY - newIORef (0.0::GLfloat)
pos - newIORef (0.0::GLfloat, 0.0, 0.0)

displayCallback $= display (map f range) rotX rotY pos

keyboardMouseCallback $= Just (keyboardMouse rotX rotY pos)
(...)

Notice that rotX, rotY and pos are meant to be used as comunication
between the keyboardMouse and display functions. They need to be set as
0 first, so display won't do anything. Only when they user press a few
buttons that those values change, so display behaves accordanly.

In a state-based language I would place display and keyboardMouse in one
module and let them communcate to each other like they want. In haskell,
I'm not quite sure how to do it except by that parameter passing style.

I thought about how state-monad may help with that. But I'm not sure how
I'd make the state variable to be contained inside a
display/keyboardMouse module.

[]'s
Rafael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Duncan Coutts
On Sun, 2009-03-22 at 01:03 +0100, Manlio Perillo wrote:
 Duncan Coutts ha scritto:
  On Sat, 2009-03-21 at 23:05 +0100, Manlio Perillo wrote:
  
  P.S: I tried to send an email to cabal-devel some days ago, with a 
  feature I would like to see in Cabal.
  But the mail was never posted to the mailing list.
  Is that list moderated?
  
  It's subscriber only, like all the haskell.org mailing lists. We got too
  much spam otherwise. :-(
  
 
 But I did subscribed!

Oh, then it should just work. There's nothing stuck in the moderation
queue, I've checked (the only things that get moderated are posts from
subscribers with very large attachments).

  Should I simply fill a ticket?
  
  Yes, thanks very much.

 Ok.
 
 I posted some details in this thread:
 http://www.haskell.org/pipermail/haskell-cafe/2009-March/057923.html

Ok, great. A feature request ticket about that would be good.


Duncan

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


Re: [Haskell-cafe] Re: Haskell Logo write-in candidate

2009-03-21 Thread Rick R
but the rest of it looks like a fat lady bending over.

2009/3/21 Henning Thielemann lemm...@henning-thielemann.de


 On Fri, 20 Mar 2009, Jon Fairbairn wrote:

  ::Haskell


 See the lamp in logo 33 at
  http://www.haskell.org/logos/poll.html

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




-- 
We can't solve problems by using the same kind of thinking we used when we
created them.
   - A. Einstein
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Sometimes I wish there was a global variable

2009-03-21 Thread Maurí­cio

Notice that rotX, rotY and pos are meant to be used as comunication
between the keyboardMouse and display functions. They need to be set as
0 first, so display won't do anything. Only when they user press a few
buttons that those values change, so display behaves accordanly.

In a state-based language I would place display and keyboardMouse in one
module and let them communcate to each other like they want. In haskell,
I'm not quite sure how to do it except by that parameter passing style.


In one module, you can write:

--
giveMeFunctions = do {
newIORef ...
newIORef ...
newIORef ...
(...)
let f1 = ...
let f2 = ...
return (f1,f2)
--

and in the main:

(keyboardMouse,display) - giveMeFunctions

Best,
Maurício

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


Re: [Haskell-cafe] Sometimes I wish there was a global variable

2009-03-21 Thread Gregory Collins
Rafael Cunha de Almeida almeida...@gmail.com writes:

 My main function goes like this:
 (...)
 rotX - newIORef (0.0::GLfloat)
 rotY - newIORef (0.0::GLfloat)
 pos - newIORef (0.0::GLfloat, 0.0, 0.0)

 displayCallback $= display (map f range) rotX rotY pos

 keyboardMouseCallback $= Just (keyboardMouse rotX rotY pos)
 (...)

 ...

 In a state-based language I would place display and keyboardMouse in one
 module and let them communcate to each other like they want. In haskell,
 I'm not quite sure how to do it except by that parameter passing style.

You could try something like this: (and apologies in advance for any
typoes)


import Control.Concurrent.MVar

data MyState = MyState {
rotX :: GLFloat
  , rotY :: GLFloat
  , pos  :: (GLFloat,GLFloat)
}


myDisplayCallback :: MVar MyState - IO ()
myDisplayCallback =
flip modifyMVar_ $ \(MyState rx ry p) - do
(newRx, newRy, newP) - yourCodeGoesHere
return $ MyState newRx newRy newP


main = do
mvar - newMVar $ MyState 0 0 (0,0)
displayCallback $= myDisplayCallback mvar
...



Cheers,
G.
-- 
Gregory Collins g...@gregorycollins.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe