[Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread Dummy
Hi,   i am really happy about this lively discussion around Haskell (Mac) GUIs.   I might hint to two other options:   1) Eclipse's SWT wraps the native platform's toolkits quite sucessfully. The platform-dependent bindings are mostly automatically generated, afaik. Some time ago i summarized my

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread Sam Martin
My conclusion was that GLFW-b (on hackage) is the best we have right now. I think we could do even better than the C libraries out there by writing the GLUT/GLFW/etc implementation purely in Haskell. We already have x11 and gtk bindings for the linux support. We have win32 api bindings for

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Johan Tibell
Hi Simon, On Wed, May 18, 2011 at 7:32 PM, Simon Meier iridc...@gmail.com wrote: In fact, one of my current goals with this work is to polish it such that it can be integrated into the 'bytestring' library. We should definitely add a builder monoid in the bytestring package. Since Write

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Henk-Jan van Tuyl
On Wed, 18 May 2011 23:21:27 +0200, Antoine Latter aslat...@gmail.com wrote: I don't have a problem with these extensions being in the Haskell Platform, as the platform currently only targets GHC, but the bytestring package itself might have a higher standard of portability. So you want the

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Antoine Latter
On May 19, 2011 4:57 AM, Henk-Jan van Tuyl hjgt...@chello.nl wrote: On Wed, 18 May 2011 23:21:27 +0200, Antoine Latter aslat...@gmail.com wrote: I don't have a problem with these extensions being in the Haskell Platform, as the platform currently only targets GHC, but the bytestring package

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread Heinrich Apfelmus
Jason Dagit wrote: As you point out we also need better libraries for creating the OpenGL context. I wrote up my searches on that front here: http://blog.codersbase.com/2011/03/picking-gui-library-to-use-with-opengl.html My conclusion was that GLFW-b (on hackage) is the best we have right

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread Heinrich Apfelmus
Conal Elliott wrote: Last I heard, wx still had the problem of crashing its host the second time one opens a window (which is typical in ghci). And last I heard, Jeremy O'Donoghue (cc'd) was exploring solutions but had very little time to pursue them. - Conal Last I remember, the latest

[Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
I'm not sure what's going on BELOW. Was working with mapAccumL earlier and decided to move over to State monad for more control. :m + Data.Map:m + Data.ListPrelude Data.List Data.Map let f key new old = new ++ oldPrelude Data.List Data.Map let moby2 = Moby Dick is a great book. Moby Dick was a

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread Thedward Blevins
On Thu, May 19, 2011 at 11:03, michael rice nowg...@yahoo.com wrote: type GeneratorState = (Map Prefix [String],Prefix,[String]) buildMap :: GeneratorState (Map Prefix [String]) You are trying to use a type alias (GeneratorState) as a type constructor. There may be other problems, but that

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
Ok, I see I left out the State word. Should be:type GeneratorState = State (Map Prefix [String],Prefix,[String]) Thanks, Michael --- On Thu, 5/19/11, Thedward Blevins thedw...@barsoom.net wrote: From: Thedward Blevins thedw...@barsoom.net Subject: Re: [Haskell-cafe] Trying to return a map from

[Haskell-cafe] For Euler 25; What is the first term in the Fibonacci sequence to contain 1000 digits?; the following seems to work.

2011-05-19 Thread KC
For Euler 25; What is the first term in the Fibonacci sequence to contain 1000 digits?; the following seems to work. -- For number of digits being 5 or more. fibNdigits :: Int - Int fibNdigits nDigits = floor (((fromIntegral nDigits) - 1.0) / (logBase 10 phi)) + 2 where sq5 = sqrt 5 ::

Re: [Haskell-cafe] No fish, please

2011-05-19 Thread Andrew Coppin
This is basically the reason I asked. Currently Cabal assumes that Haddock is the only tool of its kind. If somebody built a better Haddock, you wouldn't be able to use it. (Unless you named the executable haddock and made it accept the same command options.) Or maybe support for that tool

Re: [Haskell-cafe] No fish, please

2011-05-19 Thread Andrew Coppin
On 18/05/2011 11:25 PM, Ivan Lazar Miljenovic wrote: On 19 May 2011 08:09, Daniel Fischerdaniel.is.fisc...@googlemail.com wrote: On Wednesday 18 May 2011 23:39:47, Andrew Coppin wrote: (It also requires you to have somewhere to host, which not everybody has. Haskellwiki, bitbucket, github,

[Haskell-cafe] The Lisp Curse

2011-05-19 Thread Andrew Coppin
http://www.winestockwebdesign.com/Essays/Lisp_Curse.html Some of you might have seen this. Here's the short version: Lisp is so powerful that it discourages reuse. Why search for and reuse an existing implementation, when it's so trivially easy to reimplement exactly what you want yourself?

Re: [Haskell-cafe] For Euler 25; What is the first term in the Fibonacci sequence to contain 1000 digits?; the following seems to work.

2011-05-19 Thread Sebastian Fischer
On Thu, May 19, 2011 at 7:29 PM, KC kc1...@gmail.com wrote: For Euler 25; What is the first term in the Fibonacci sequence to contain 1000 digits?; the following seems to work. -- For number of digits being 5 or more. fibNdigits :: Int - Int fibNdigits nDigits = floor (((fromIntegral

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Vo Minh Thu
2011/5/19 Andrew Coppin andrewcop...@btinternet.com: http://www.winestockwebdesign.com/Essays/Lisp_Curse.html Some of you might have seen this. Here's the short version:  Lisp is so powerful that it discourages reuse. Why search for and reuse an existing implementation, when it's so

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Serguey Zefirov
I think this is much less applicable to Haskell than to Lisp. I think that most of intra-incompatibilities of Lisp stem from side effects. The rest is mostly due to (relatively) weak type system which let some errors slip. And remaining percent or two can be attributed to the power of Lisp. ;)

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Serguey Zefirov
2011/5/19 Vo Minh Thu not...@gmail.com: 2011/5/19 Andrew Coppin andrewcop...@btinternet.com: http://www.winestockwebdesign.com/Essays/Lisp_Curse.html Some of you might have seen this. Here's the short version:  Lisp is so powerful that it discourages reuse. Why search for and reuse an

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Gilberto Garcia
I think what Andrew meant is that it's not a good idea to have big pile of different implementations of the same library, and all trying to solve the very same problem. I see this kind of problem in the java community. It seems that developers have a need to create everything from scratch more

Re: [Haskell-cafe] No fish, please

2011-05-19 Thread Daniel Fischer
On Thursday 19 May 2011 20:27:16, Andrew Coppin wrote: This is basically the reason I asked. Currently Cabal assumes that Haddock is the only tool of its kind. If somebody built a better Haddock, you wouldn't be able to use it. (Unless you named the executable haddock and made it accept

[Haskell-cafe] where is it appropriate to write library-related suggestions?

2011-05-19 Thread Nicholas Tung
Hi all, I am curious if there is an avenue to make suggestions / comments about libraries? For example, proc in System.Process conflicts with the Arrows notation proc, yielding confusing error messages. thanks, Nicholas — https://ntung.com — CS and Mathematics major @ UC Berkeley

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Daniel Patterson
Correct my ignorance as I'm rather new around here, but I'm not sure if I actually think this happens that much. Different approaches are often put forth, which does mean that there are incompatible libraries that fill the same space for a while, but it seems that once it becomes clear what

Re: [Haskell-cafe] where is it appropriate to write library-related suggestions?

2011-05-19 Thread Henning Thielemann
On Thu, 19 May 2011, Nicholas Tung wrote: Hi all,     I am curious if there is an avenue to make suggestions / comments about libraries? For example, proc in System.Process conflicts with the Arrows notation proc, yielding confusing error messages. For the base libraries, you may e-mail to:

Re: [Haskell-cafe] where is it appropriate to write library-related suggestions?

2011-05-19 Thread Nicholas Tung
On Thu, May 19, 2011 at 3:21 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Thu, 19 May 2011, Nicholas Tung wrote: Hi all, I am curious if there is an avenue to make suggestions / comments about libraries? For example, proc in System.Process conflicts with the Arrows

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Felipe Almeida Lessa
On Thu, May 19, 2011 at 3:50 PM, Serguey Zefirov sergu...@gmail.com wrote: The solution... I think that some ratings, like used directly by ### packages/projects and indirectly by ### would be nice, but not much. As for me, I like the diversity of packages. They attack close problems from

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Stephen Tetley
Och Mr Coppin Lisp is a fine language, but all Lisp essays you'll find on the internet except Richard Gabriel's Worse is Better are absolute tosh. Read Olin Shiver's introduction to SRE regex notation for an intelligent contribution to the 6 different libraries problem you seem to be having,

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Don Stewart
This is classic community trolling behavior, Andrew. You post something inflammatory, questioning the core value of our project, without a clear argument about why it article relevant, and then step away to let a monster thread consume everything, as people try to work out what your point was,

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Simon Meier
Hi Antoine, thanks for your feedback. 2011/5/18 Antoine Latter aslat...@gmail.com: On Wed, May 18, 2011 at 12:32 PM, Simon Meier iridc...@gmail.com wrote: Hello Haskell-Cafe, There are many providers of Writes. Each bounded-length-encoding of a standard Haskell value is likely to have a

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Andrew Coppin
On 19/05/2011 07:56 PM, Gilberto Garcia wrote: I think what Andrew meant is that it's not a good idea to have big pile of different implementations of the same library, and all trying to solve the very same problem. I'm glad somebody understood what I was trying to get at. I'm not saying that

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Andrew Coppin
On 19/05/2011 08:39 PM, Stephen Tetley wrote: Och Mr Coppin Lisp is a fine language, but all Lisp essays you'll find on the internet except Richard Gabriel's Worse is Better are absolute tosh. This wasn't an attempt to bash Lisp. This is about all those people who think having multiple

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Andrew Coppin
On 19/05/2011 08:58 PM, Don Stewart wrote: This is classic community trolling behavior, Andrew. And publicly calling somebody a troll isn't trolling behaviour? I'm going to answer the rest of this off-list. I'm sure nobody else wants to hear it.

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
OK. Again, not sure what going on here. Pattern looks OK to me. Michael = import Control.Monad.Stateimport Data.Map type Prefix = (String,String)type GeneratorState = State ((Map Prefix [String]),Prefix,[String]) non_word = \n f key new old = new ++ old  buildMap ::

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread vagif . verdi
Andrew, you are being non constructive. You are saying We should. Who we, Andrew ? Who are you referring to ? The developers who created those six different unicode libraries are not united under any umbrella you can call we. The reason those six libraries existis is NOT because some mysterious

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Simon Meier
Hi Johan, thanks for the extensive and motivating feedback. 2011/5/19 Johan Tibell johan.tib...@gmail.com: On Wed, May 18, 2011 at 7:32 PM, Simon Meier iridc...@gmail.com wrote: In fact, one of my current goals with this work is to polish it such that it can be integrated into the

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Stephen Tetley
On 19 May 2011 21:20, Andrew Coppin andrewcop...@btinternet.com wrote: This is about all those people who think having multiple libraries which only solve half the problem is somehow a good thing. Och (number 2) Those people are the Straw Men - you can wave at them from your car window when

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Andrew Coppin
On 19/05/2011 09:34 PM, vagif.ve...@gmail.com wrote: Andrew, you are being non constructive. It seems I'm being misunderstood. Some people seem to hold the opinion that more libraries = better. I'm trying to voice the opinion that there is such a thing as too many libraries. The article I

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread aditya siram
The problem is that the all@(w1:words) pattern-match fails when all is empty. The quick and dirty fix is: import Control.Monad.State import Data.Map import Debug.Trace type Prefix = (String,String) type GeneratorState = State ((Map Prefix [String]),Prefix,[String])

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
A laugh a minute. I though of that and tried it but got the same response (forgetting to :r my source) before rerunning. Time for a break. Thanks! Michael  --- On Thu, 5/19/11, aditya siram aditya.si...@gmail.com wrote: From: aditya siram aditya.si...@gmail.com Subject: Re: [Haskell-cafe] Trying

[Haskell-cafe] Reverse Show instance

2011-05-19 Thread Andrew Coppin
Cannot deduce (Show x) from context (Show (x, y)). Cannot deduce (Show y) from context (Show (x, y)). Um... seriously? From Prelude, we have Show x, Show y = Show (x, y) So clearly it works in the forward direction. But apparently not in the reverse direction. Is this a bug or a

Re: [Haskell-cafe] Reverse Show instance

2011-05-19 Thread Artyom Kazak
And I can declare an instance for (x, y) which does NOT implies (Show x): instance Show (x, y) where show _ = I'm tuple! Hooray! Andrew Coppin andrewcop...@btinternet.com писал(а) в своём письме Fri, 20 May 2011 00:08:27 +0300: Cannot deduce (Show x) from context (Show (x, y)).

Re: [Haskell-cafe] Reverse Show instance

2011-05-19 Thread Andrew Coppin
On 19/05/2011 10:11 PM, Artyom Kazak wrote: And I can declare an instance for (x, y) which does NOT implies (Show x): instance Show (x, y) where show _ = I'm tuple! Hooray! Ah. So it's a feature. Fortunately I refactored the program where this came up, so it's no longer an issue. I just

Re: [Haskell-cafe] Reverse Show instance

2011-05-19 Thread Markus Läll
If you have nested type, then it usually makes sense to have Show defined for the inside types, too, but it's not a requirement. Technically, only when you call 'show' for something in the data type you are defining Show for, *then* you need a Show instance defined for that inside-type. On Fri,

Re: [Haskell-cafe] Reverse Show instance

2011-05-19 Thread Daniel Fischer
On Thursday 19 May 2011 23:15:06, Andrew Coppin wrote: On 19/05/2011 10:11 PM, Artyom Kazak wrote: And I can declare an instance for (x, y) which does NOT implies (Show x): instance Show (x, y) where show _ = I'm tuple! Hooray! Ah. So it's a feature. Fortunately I refactored the

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Julian Porter
ultimately the ideal is to end up with one library that solves the problem well, which everybody can use. Nonsense. One library that everyone can use with either end up being so small in functionality that it's actually useless, or so general that either it requires tons and tons of

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Ketil Malde
Andrew Coppin andrewcop...@btinternet.com writes: I'm trying to voice the opinion that there is such a thing as too many libraries. The article I linked to explains part of why this is the case, in a better way than I've been able to phrase it myself. I don't think so, the article seems to

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread aditya siram
I wonder if it would be useful to be able to download and use only necessary modules from Hackage. This way if someone writes, say a superior XML parsing API, and someone else has better generating API, the user can pull just those modules , write the glue and have the best of both worlds. On the

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Antoine Latter
On Thu, May 19, 2011 at 3:06 PM, Simon Meier iridc...@gmail.com wrote: The core problem that drove me towards this solution is the abundance of different IntX and WordX types. Each of them requiring a separate Write for big-endian, little-endian, host-endian, lower-case-hex, and uper-case-hex

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Daniel Peebles
The way I understand it, you're saying not that we shouldn't be doing it this way (since it isn't centrally managed, it's the only possible way), but that we shouldn't be bragging (for lack of a better word) that we have lots of libraries that do a specific thing. Or if not that, then at least

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Henning Thielemann
Simon Meier schrieb: There are many providers of Writes. Each bounded-length-encoding of a standard Haskell value is likely to have a corresponding Write. For example, encoding an Int32 as a big-endian, little-endian, and host-endian byte-sequence is currently achieved with the following

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread austin seipp
I too am not all that concerned about the library proliferation, and I think such work can definitely help find the best design for certain abstractions. There are no less than 3 iteratee libraries - 4 including liboleg's original IterateeM formulation - and a number of FRP implementations as

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread David Leimbach
See the Haskell Platform. Sent from my iPhone On May 19, 2011, at 1:56 PM, Andrew Coppin andrewcop...@btinternet.com wrote: On 19/05/2011 09:34 PM, vagif.ve...@gmail.com wrote: Andrew, you are being non constructive. It seems I'm being misunderstood. Some people seem to hold the

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread Bas van Dijk
On 19 May 2011 10:53, Johan Tibell johan.tib...@gmail.com wrote: Long term we'd like to switch bytestring over from ForeignPtr to ByteArray#, if possible. There are currently some technical obstacles to such a switch BTW I'm working with Roman Leshchinskiy to create the vector-bytestring

Re: [Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform

2011-05-19 Thread wren ng thornton
On 5/19/11 5:51 PM, Antoine Latter wrote: On Thu, May 19, 2011 at 3:06 PM, Simon Meieriridc...@gmail.com wrote: The core problem that drove me towards this solution is the abundance of different IntX and WordX types. Each of them requiring a separate Write for big-endian, little-endian,

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Eric Rasmussen
I only recently started learning Haskell and have had a difficult time convincing other Python hackers to come on board. I see two things that might help: 1) A resource to make informed decisions about different libraries. Something that includes specific criteria like how long a library has been

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread John Lask
On 19/05/2011 10:31 PM, Heinrich Apfelmus wrote: my comments for what their worth: (1) wx and ghci: I successfully run wx in ghci (albeit) on windows. I take an alternative path to that proscribed by the current build process - I think principally so that I am able to run it in ghci, although

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread KC
Do GUIs or interactive graphics in Haskell work a lot better on Windows and/or various Linux distro's? On Tue, May 17, 2011 at 4:24 PM, Conal Elliott co...@conal.net wrote: I still haven't found any way to do GUIs or interactive graphics in Haskell on a Mac that isn't plagued one or more of

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread Felipe Almeida Lessa
On Thu, May 19, 2011 at 9:23 PM, John Lask jvl...@hotmail.com wrote: A general problem with strategic response is they underestimate the effort required due to the long range horizon and the uncertainties involved. The efforts in building a cross-platform GUI are not to be underestimated.

Re: [Haskell-cafe] Reverse Show instance

2011-05-19 Thread Ryan Ingram
Think of it this way: -- Here is some data representing the typeclass 'Show' data ShowDict a = ShowD (a - String) show :: ShowDict a - a - String show (ShowD f) a = f a -- Here's a sample implementation for Strings showString :: ShowDict String showString = ShowD (\s - \ ++ escape s ++ \) where

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-19 Thread Evan Laforge
On Thu, May 19, 2011 at 5:32 PM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Thu, May 19, 2011 at 9:23 PM, John Lask jvl...@hotmail.com wrote: A general problem with strategic response is they underestimate the effort required due to the long range horizon and the uncertainties

Re: [Haskell-cafe] The Lisp Curse

2011-05-19 Thread Evan Laforge
2) Languages like Python make it easy to write fast performing code in a few lines that will read/write files, split strings, and build lists or dictionaries/associative arrays. There are very clever ways of doing all these things Haskell, but it can involve several qualified imports and time