[Haskell-cafe] ICMP in Haskell (was Elevator pitch for Haskell)

2007-09-09 Thread Dominic Steinitz
Does it enable you to, say, send raw ICMP packets? AFAIK, Haskell supports TCP, and nothing else. (A while back I wanted to write an automated pinging program. But the only way I could figure out how to do it is to call the OS ping utility and attempt to parse what it writes to stdout.

Re: [Haskell-cafe] Hackage and GHC 6.8

2007-09-09 Thread Neil Davies
Ah, this begins to answer my question: there isn't really a plan I would have thought that he first step is to be able to distinguish which of the hackage packages compile under 6.8 - some annotation to the hackage DB? Secondly, is there a dependency graph of the stuff on hackage anywhere?

Re: [Haskell-cafe] Hackage and GHC 6.8

2007-09-09 Thread Neil Davies
Thinking on it more - surely there is enough information from the failed compilations to suggest changes to the cabal files? Feed them back to the developers? My thoughts go this way - people like creating, that's why hackage is beginning to grow. They don't tend to like the packaging issues -

[Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Peter Verswyvelen
I find it unfortunate that one can't (I guess) define custom unary operators in Haskell. Is this correct? If so, is this just because eg (* 100) declares a function that partially applies the * operator, so this syntax disallows unary operators? Could this be fixed by introducing a different

[Haskell-cafe] zip, map and zipWith for arrays

2007-09-09 Thread Axel Gerstenberger
Hi all, thanks again for all the responses on the imperative loop question. Here is another questions: I am used to work with map, zip and zipWith, when working with lists, however, I could not find such functions for Arrays. For example, in my Finite Element prototype, I have a function

Re: [Haskell-cafe] ((a - b) - c) - (a - m b) - m c

2007-09-09 Thread Henning Thielemann
On Sun, 9 Sep 2007, Stuart Cook wrote: (Inspired by this[1] reddit thread.) When combining monadic and non-monadic code, I've often wished for a magical combinator of type (Monad m) = ((a - b) - c) - (a - m b) - m c which would let me inject a monadic function into a pure one, then wrap

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Henning Thielemann
On Sun, 9 Sep 2007, Peter Verswyvelen wrote: I find it unfortunate that one can't (I guess) define custom unary operators in Haskell. Why? What is your application? In fact, alphanumeric identifiers are used as unary operators. Is this correct? If so, is this just because eg (* 100)

Re: [Haskell-cafe] zip, map and zipWith for arrays

2007-09-09 Thread Henning Thielemann
On Sun, 9 Sep 2007, Axel Gerstenberger wrote: I am used to work with map, zip and zipWith, when working with lists, however, I could not find such functions for Arrays. Since 'Array' is an instance of Functor you can use 'fmap' for applying a function to all elements. For example, in my

Re: [Haskell-cafe] ((a - b) - c) - (a - m b) - m c

2007-09-09 Thread Stuart Cook
On 9/9/07, Henning Thielemann [EMAIL PROTECTED] wrote: If the signature would be (Monad m) = ((a - b) - c) - m (a - b) - m c it would be possible, and the implementation would be 'liftM'/'fmap'. Thanks, that's the kind of insight I was looking for. Hmm. A key distinction between (a - m

Re: [Haskell-cafe] Installation of GLUT package

2007-09-09 Thread Claus Reinke
Loading package OpenGL-2.2.1 ... linking ... done. Loading package GLUT-2.1.1 ... linking ... done. The above message was after you have installed GLUT-2.0, but GHC was still loading GLUT-2.1.1. The later errors were caused by your forced copy of 2.0 lib over the default 2.1.1. I noticed

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Peter Verswyvelen
Why? What is your application? In fact, alphanumeric identifiers are used as unary operators. Why? Well, why are binary operators allowed and unary operators not? Isn't that some kind of discrimination? In math, many many operators are unary. Haskell allows creating binary operators. So I

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Brandon S. Allbery KF8NH
On Sep 9, 2007, at 9:09 , Peter Verswyvelen wrote: I think that the benefits of prefix or postfix symbolic operators were not worth dispensing with the comfortable section syntax. Well, that's personal I guess, but I would prefer the syntax (? / 100) and (100 / ?), which is just a single

Re: [Haskell-cafe] Hackage and GHC 6.8

2007-09-09 Thread Marc Weber
are seen as a distraction the more we can automate this the better, I've run into this trouble as well. And libraries will change... or there will be libraries which are not updated etc.. I think another way would be having some automatism in fixing the most obvious things.. Such as if package

[Haskell-cafe] Tiny documentation request

2007-09-09 Thread Andrew Coppin
I have the following page bookmarked: http://haskell.org/ghc/docs/latest/html/libraries/ I'd like to ask 2 things. 1. Would it be possible to make the *huge* list of package names at the top collapsable? (That way I don't have to scroll through several pages of uninteresting text to get to

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Malcolm Wallace
On Sun, 9 Sep 2007, Peter Verswyvelen wrote: I find it unfortunate that one can't (I guess) define custom unary operators in Haskell. Incidentally, the nhc98 compiler has always permitted the definition of unary operators, as an extension to the language. (It was just more convenient to

Re: [Haskell-cafe] Tiny documentation request

2007-09-09 Thread Johan Tibell
I agree about the top part. It's not very interesting, especially not in a document used as a reference. Perhaps we could move it to the end and provide an anchor link from the different modules down to their package explanation. A tip is to use Firefox's search as you type feature if you know

Re: [Haskell-cafe] Tiny documentation request

2007-09-09 Thread Sven Panne
On Sunday 09 September 2007 16:40, Andrew Coppin wrote: I have the following page bookmarked: http://haskell.org/ghc/docs/latest/html/libraries/ I'd like to ask 2 things. 1. Would it be possible to make the *huge* list of package names at the top collapsable? (That way I don't have to

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Derek Elkins
On Sun, 2007-09-09 at 15:09 +0200, Peter Verswyvelen wrote: Why? What is your application? In fact, alphanumeric identifiers are used as unary operators. Why? Well, why are binary operators allowed and unary operators not? Isn't that some kind of discrimination? In math, many many

Re: [Haskell-cafe] Tiny documentation request

2007-09-09 Thread Andrew Coppin
Sven Panne wrote: On Sunday 09 September 2007 16:40, Andrew Coppin wrote: 1. Would it be possible to make the *huge* list of package names at the top collapsable? (That way I don't have to scroll through several pages of uninteresting text to get to the bit I actually want.) What do

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Peter Verswyvelen
Brandon S. Allbery KF8NH wrote: On Sep 9, 2007, at 9:09 , Peter Verswyvelen wrote: I think that the benefits of prefix or postfix symbolic operators were not worth dispensing with the comfortable section syntax. Well, that's personal I guess, but I would prefer the syntax (? / 100) and (100 /

Re: [Haskell-cafe] Tiny documentation request

2007-09-09 Thread Neil Mitchell
Hi I have the following page bookmarked: http://haskell.org/ghc/docs/latest/html/libraries/ Just bookmark: http://haskell.org/hoogle It's not perfect, but it probably solves lots of your problems. A tip is to use Firefox's search as you type feature if you know the module name. This

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Peter Verswyvelen
Malcolm Wallace wrote: Incidentally, the nhc98 compiler has always permitted the definition of unary operators, as an extension to the language. (It was just more convenient to create a general mechanism for unary/prefix operators, than to code the special case for negative numbers.) Cool! I

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Henning Thielemann
On Sun, 9 Sep 2007, Peter Verswyvelen wrote: Why? What is your application? In fact, alphanumeric identifiers are used as unary operators. Why? Well, why are binary operators allowed and unary operators not? Isn't that some kind of discrimination? In math, many many operators are unary.

[Haskell-cafe] simple parsing (parsec) intro

2007-09-09 Thread Tim Newsham
I wrote a small intro about how to write a parser in haskell. Its basically about parsec and how it works, but its written without directly referencing parsec and aimed towards beginners (basically wrote it for some friends). Any feedback is appreciated.

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Peter Verswyvelen
Henning Thielemann wrote: The more syntactic constructs exist, the more complicated it becomes to read such programs. Today, if you read a symbolic operator which is not -, not a single dot with a capital identifier to the left (qualification), not a double dot in a bracket (enumeration) and

Re: [Haskell-cafe] Installation of GLUT package

2007-09-09 Thread Paul L
On 9/8/07, Ronald Guida [EMAIL PROTECTED] wrote: Clearly, I'm missing something here. Where do I have to go to get the latest version of GLUT? You can get it using darcs: darcs get http://darcs.haskell.org/packages/GLUT/ Also, after I built freeglut with VS-2003, I copied the include

[Haskell-cafe] Where would I find fromInt?

2007-09-09 Thread PR Stanley
Hi Where would I find the fromInt function, please? Better still, would anyone know how to write a func for converting int to float and vice versa? Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Where would I find fromInt?

2007-09-09 Thread Tom Harper
Hi Paul -- The function you want is called fromIntegral, and works for all Integral types. Using it, you can add a type signature to specify what you want to change the number to (Float, Double, other Integral type, etc. Example: fromIntegral (4 :: Int) :: Double 4.0 Hope this helps! -- Tom

Re: [Haskell-cafe] Speed of character reading in Haskell

2007-09-09 Thread ok
On 7 Sep 2007, at 11:22 pm, Chaddaï Fouché wrote: From what I can see of your program, it would greatly benefit from using Data.ByteString, is there an obvious reason not to use it ? I am writing a a set of tools to process a legacy programming language, as I said. Speed is not, in fact, a

Re: [Haskell-cafe] Speed of character reading in Haskell

2007-09-09 Thread Neil Mitchell
Hi (Some list operations are too expensive with ByteString but for most string processing it's perfectly fine and much faster than String). I'm sure it's true, but it's quite irrelevant to my question, which is why is using getChar so much slower than using getContents? Buffering, blocks

Re: [Haskell-cafe] Speed of character reading in Haskell

2007-09-09 Thread Derek Elkins
On Mon, 2007-09-10 at 00:49 +0100, Neil Mitchell wrote: Hi (Some list operations are too expensive with ByteString but for most string processing it's perfectly fine and much faster than String). I'm sure it's true, but it's quite irrelevant to my question, which is why is using

Re: [Haskell-cafe] Where would I find fromInt?

2007-09-09 Thread Albert Y. C. Lai
To the tune of the theme song of Ghostbusters: You've got an Int But you want Double Who do you call? fromIntegral! (The inverse conversion requires you to think about rounding first.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Elevator pitch for Haskell.

2007-09-09 Thread Devin Mullins
Stefan O'Rear wrote: I'd like to add that, until very recently, Haskell wasn't even *trying* to be ready for prime time. This is a subject that comes up in Ruby-land quite a bit. It piques my curiosity. Obviously, Haskell is not, on its own, sentient. (Nor is the Haskell community a hivemind.)

[Haskell-cafe] Comments and/or Criticisms

2007-09-09 Thread PR Stanley
Hi Any comments and/or criticisms would be most appreciated: --count the occurrences of char in string countC :: Char - [Char] - Int countC x xs = sum [1 | c - xs, c == x] --count occurrences of chars in string countCS :: [Char] - [(Char, Int)] countCS xs = [(x, (countC x xs)) | x - [' '..'z'],

Re: [Haskell-cafe] Speed of character reading in Haskell

2007-09-09 Thread ok
On 10 Sep 2007, at 11:49 am, Neil Mitchell wrote: Buffering, blocks and locks. Buffering: getChar demands to get a character now, which pretty much means you can't buffer. Eh what? getchar() in C demands to get a character now, which is fully compatible with as much buffering as you want.

Re: [Haskell-cafe] Elevator pitch for Haskell.

2007-09-09 Thread Brian Hurt
On Sun, 9 Sep 2007, Devin Mullins wrote: As for the latter, the reason I hear most often is I want to be able to use the language at my job.* Yet, I have heard two presentations from people who studied the history of Smalltalk/Java/etc. and came to the (informal) conclusion that the very

Re: [Haskell-cafe] Comments and/or Criticisms

2007-09-09 Thread Stuart Cook
On 9/10/07, PR Stanley [EMAIL PROTECTED] wrote: Can anyone come up with a better alternative? *puts on his pointfree hat* import Control.Arrow (()) import Data.List (group, sort) countCS :: [Char] - [(Char, Int)] -- Char can be generalised to any Ord countCS = map (head length) .

[Haskell-cafe] Pairing function

2007-09-09 Thread ok
I wanted to use the standard name for the function pair :: (a - b) - (a - c) - (a - (b,c)) pair f g x = (f x, g x) but I can find no such function in the Report or its Libraries. Is there a recommended name for this? ___ Haskell-Cafe

Re: [Haskell-cafe] Pairing function

2007-09-09 Thread Felipe Almeida Lessa
On 9/9/07, ok [EMAIL PROTECTED] wrote: I wanted to use the standard name for the function pair :: (a - b) - (a - c) - (a - (b,c)) pair f g x = (f x, g x) but I can find no such function in the Report or its Libraries. Is there a recommended name for this? It is called ()

Re: [Haskell-cafe] zip, map and zipWith for arrays

2007-09-09 Thread ok
On 9 Sep 2007, at 10:05 pm, Axel Gerstenberger wrote: I am used to work with map, zip and zipWith, when working with lists, however, I could not find such functions for Arrays. They aren't there for at least two reasons. (1) They are easy to implement on top of the operations that are

Re: [Haskell-cafe] Installation of GLUT package

2007-09-09 Thread Ronald Guida
Paul L wrote: But again, why stuck with GLUT? Now there is at least one alternative, GLFW (http://glfw.sourceforge.net) a cross-platform framework for OpenGL applications, for which I recently wrote a Haskell interface, downloadable at http://www.haskell.org/soe/software1.htm. It's certainly

Re: [Haskell-cafe] Elevator pitch for Haskell.

2007-09-09 Thread Devin Mullins
Brian Hurt wrote: Any links to these presentations? I'm interested. Videos: http://rubyhoedown2007.confreaks.com/session04.html http://rubyhoedown2007.confreaks.com/session07.html Unfortunately, I couldn't find any slides for download. Watch at your own peril! Devin

Re: [Haskell-cafe] Comments and/or Criticisms

2007-09-09 Thread Devin Mullins
Alternatives; use your own judgment: PR Stanley wrote: --count the occurrences of char in string countC :: Char - [Char] - Int countC x xs = sum [1 | c - xs, c == x] -- Direct mind-mapping of my brain: countC x = length . filter (c ==) -- Avoids constructing an intermediate list? I dunno.

Re: [Haskell-cafe] Comments and/or Criticisms

2007-09-09 Thread Stuart Cook
On 9/10/07, PR Stanley [EMAIL PROTECTED] wrote: Hi Any comments and/or criticisms would be most appreciated: --count the occurrences of char in string countC :: Char - [Char] - Int countC x xs = sum [1 | c - xs, c == x] That's a clever implementation, but I think there are clearer ways of