[GHC] #2275: Poor indication of type error location

2008-05-09 Thread GHC
#2275: Poor indication of type error location +--- Reporter: guest| Owner: Type: bug | Status: new Priority: normal | Component:

Re: [GHC] #2275: Poor indication of type error location

2008-05-09 Thread GHC
#2275: Poor indication of type error location +--- Reporter: guest|Owner: Type: bug | Status: new Priority: normal |

Re: [GHC] #2275: Poor indication of type error location

2008-05-09 Thread GHC
#2275: Poor indication of type error location -+-- Reporter: guest| Owner: Type: bug | Status: new Priority: normal |

Re: [GHC] #2269: Word type to Double or Float conversions are slower than Int conversions

2008-05-09 Thread GHC
#2269: Word type to Double or Float conversions are slower than Int conversions +--- Reporter: dons| Owner: [EMAIL PROTECTED] Type: feature request | Status: new

Re: [GHC] #1958: collect2: ld terminated with signal 10 [Bus error]: Building parsec on a PPC Mac OS X 10.5 Leopard as part of GHC 6.9

2008-05-09 Thread GHC
#1958: collect2: ld terminated with signal 10 [Bus error]: Building parsec on a PPC Mac OS X 10.5 Leopard as part of GHC 6.9 -+-- Reporter: thorkilnaur | Owner: thorkilnaur Type: bug |

[GHC] #2277: GHCi silently aborts on 'take' computation

2008-05-09 Thread GHC
#2277: GHCi silently aborts on 'take' computation ---+ Reporter: cdsmith | Owner: Type: bug | Status: new Priority: normal | Component: GHCi

[Haskell] REMINDER: Haskell Communities and Activities Report

2008-05-09 Thread Janis Voigtlaender
Dear Haskellers, It is not yet too late to contribute to the 14th edition of the HCA Report. The deadline is this weekend, Saturday, 10 May 2008. If you haven't already, please write an entry for your new project or update your old entry. Please mail your entries to hcar at haskell dot org

Re: [Haskell] [Haskell-cafe] Help with polymorphic functions

2008-05-09 Thread Abhay Parvate
You can also drop the type signature and see what type deduction you get in ghci :) Your program would have compiled well without the type signature! It's also a good exercise to come up with the most general type of a function that you write, and then compare it with the type that is deduced by

[Haskell] Announce: SCC, Streaming Component Combinator library

2008-05-09 Thread Mario Blazevic
I'm pleased to announce the 0.1 release of Streaming Component Combinators in Haskell, based on my earlier work done in OmniMark and published in paper Mario Blažević, Streaming component combinators, Extreme Markup Languages, 2006.

[Haskell-cafe] resource exhausted

2008-05-09 Thread Galchin, Vasili
Hello, I am running some monadic code that I have written. I double checked my code and it seems to be ok (no guarantee though). I am getting a resource exhausted (Message too long). I just did a google on resource exhausted and saw a few posts on the number of open files which is obviously

Re: [Haskell-cafe] I am new to haskell

2008-05-09 Thread Giorgio Valoti
On 08/mag/08, at 08:59, Benjamin L. Russell wrote: One hint that is not (at least to my knowledge) listed on haskell.org is that, according to at least one user (see The Programmers’ Stone » Blog Archive » A First Haskell Experience at

Re: [Haskell-cafe] The Monad.Reader (11) - Call for Copy

2008-05-09 Thread Wouter Swierstra
Hi Donnie, Any chance of those issues being moved over still? I'd prefer to read the older issues in pdf format, like the new issues. I have gotten permission from (almost) all the authors to move the content to the new wiki. I've started reformatting everything to the MediaWiki format

[Haskell-cafe] Re: resource exhausted

2008-05-09 Thread Galchin, Vasili
More importantly I grepped(Linux) through the ghc6.8.2 source for resource exhausted .. maybe incorrectly ?? Vasili On Fri, May 9, 2008 at 1:04 AM, Galchin, Vasili [EMAIL PROTECTED] wrote: Hello, I am running some monadic code that I have written. I double checked my code and it seems

[Haskell-cafe] REMINDER: Haskell Communities and Activities Report

2008-05-09 Thread Janis Voigtlaender
Dear Haskellers, It is not yet too late to contribute to the 14th edition of the HCA Report. The deadline is this weekend, Saturday, 10 May 2008. If you haven't already, please write an entry for your new project or update your old entry. Please mail your entries to hcar at haskell dot org

Re[2]: [Haskell-cafe] I am new to haskell

2008-05-09 Thread Bulat Ziganshin
Hello Giorgio, Friday, May 9, 2008, 10:40:47 AM, you wrote: be the next one. Should I wait for Real world Haskell or do you think that the books you listed offer something new/different/more advanced than Programming in Haskell? i recommend you to read papers from the

[Haskell-cafe] Re: [Haskell] Re: ANN: Haddock version 2.1.0

2008-05-09 Thread Simon Marlow
David Waern wrote: 2008/5/8 Simon Marlow [EMAIL PROTECTED]: So basically you want to run a lexer over the source again to collect all the comments? Yes. You really want to use GHC's lexer, because otherwise you have to write another lexer. I don't mind writing a lexer that just collects

Re: [Haskell-cafe] Stack vs Heap allocation

2008-05-09 Thread Edsko de Vries
Hi, No, the thunks are (usually) stored on the heap. You don't get the stack overflow until you actually force the computation at which point you have an expression like: (...(((1+2)+3)+4) ... + 1000) which requires stack in proportion to the number of nested parentheses (effectively)

Re: [Haskell-cafe] Stack vs Heap allocation

2008-05-09 Thread Malcolm Wallace
Edsko de Vries [EMAIL PROTECTED] wrote: (...(((1+2)+3)+4) ... + 1000) which requires stack in proportion to the number of nested parentheses Ah, that makes! So does it make sense to talk about tail recursive thunks? Or does the evaluation of thunks always take stack space

[Haskell-cafe] Re: [Haskell] Re: ANN: Haddock version 2.1.0

2008-05-09 Thread David Waern
2008/5/9 Simon Marlow [EMAIL PROTECTED]: David Waern wrote: 2008/5/8 Simon Marlow [EMAIL PROTECTED]: So basically you want to run a lexer over the source again to collect all the comments? Yes. You really want to use GHC's lexer, because otherwise you have to write another lexer. I

Re: [Haskell-cafe] Induction (help!)

2008-05-09 Thread PR Stanley
Paul: okay, da capo: We prove/test through case analysis that the predicate p holds true for the first/starting case/element in the sequence. When dealing with natural numbers this could be 0 or 1. We try the formula with 0 and if it returns the desired result we move onto the next

Re: Re[2]: [Haskell-cafe] I am new to haskell

2008-05-09 Thread Benjamin L. Russell
--- On Fri, 5/9/08, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Giorgio, Friday, May 9, 2008, 10:40:47 AM, you wrote: be the next one. Should I wait for Real world Haskell or do you think that the books you listed offer something new/different/more advanced than Programming in

Re: [Haskell-cafe] The Monad.Reader (11) - Call for Copy

2008-05-09 Thread Brandon S. Allbery KF8NH
On 2008 May 9, at 2:51, Wouter Swierstra wrote: Any chance of those issues being moved over still? I'd prefer to read the older issues in pdf format, like the new issues. I have gotten permission from (almost) all the authors to move the content to the new wiki. I've started reformatting

Re: [Haskell-cafe] resource exhausted

2008-05-09 Thread Brandon S. Allbery KF8NH
On 2008 May 9, at 2:04, Galchin, Vasili wrote: I am running some monadic code that I have written. I double checked my code and it seems to be ok (no guarantee though). I am getting a resource exhausted (Message too long). I just did a google on resource exhausted and saw a few posts

Re: [Haskell-cafe] Induction (help!)

2008-05-09 Thread Daniel Fischer
Am Freitag, 9. Mai 2008 13:50 schrieb PR Stanley: Paul: okay, da capo: We prove/test through case analysis that the predicate p holds true for the first/starting case/element in the sequence. When dealing with natural numbers this could be 0 or 1. We try the formula with 0 and if it

[Haskell-cafe] FFI: Creating a Storable for a C-struct composed of char arrays

2008-05-09 Thread Olivier Boudry
Hi all, I'm trying to make RFC calls to SAP using the nwsaprfc library. Some structs defined in the library contains arrays (byte or word arrays). For example: typedef struct _RFC_ATTRIBUTES { SAP_UC dest[64+1]; /* RFC destination */ SAP_UC host[100+1];

Re: [Haskell-cafe] FFI: Creating a Storable for a C-struct composed of char arrays

2008-05-09 Thread Brandon S. Allbery KF8NH
On 2008 May 9, at 9:42, Olivier Boudry wrote: Of course it won't work as HArrayStruct in file HArrayStruct.hs uses Strings and String is not an instance of Storable. Ideally I would need some sort of Storable array of char. Is Data.Storable.Array the type I'm looking for? Could someone

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread Andrew Coppin
Darrin Thompson wrote: 2008/5/8 Donnie Jones [EMAIL PROTECTED]: I would be interested to see an article on Haskell in the same light as this Ocaml article, aka a constructive criticism of Haskell. http://www.drmaciver.com/2008/02/tell-us-why-your-language-sucks/ Impressive. He

[Haskell-cafe] GHC API: how to get the typechecked AST?

2008-05-09 Thread Gerbo Engels
Hello all, In the GHC Commentary [1] I can read that the type checker adds type information to the syntax tree. So I would expect that there is a way to get a syntax tree of type HsModule Id. The GHC API provides functions checkModule and checkAndLoadModule which both return a CheckedModule that

[Haskell-cafe] List concat

2008-05-09 Thread Andrew Coppin
The function (++) :: [x] - [x] - [x] has O(n) complexity. If somebody were to invent some type that looks like [x] but actually uses some sort of tree rather than a linked list, you should be able to get O(1) concatenation. Has anybody ever implemented such a thing?

Re: [Haskell-cafe] List concat

2008-05-09 Thread Neil Mitchell
Hi data List a = Zero | One a | Two (List a) (List a) On Fri, May 9, 2008 at 3:16 PM, Andrew Coppin [EMAIL PROTECTED] wrote: The function (++) :: [x] - [x] - [x] has O(n) complexity. (++) = Two -- O(1) complexity If somebody were to invent some type that looks like [x] but actually uses

[Haskell-cafe] [ANN] Twitter Client

2008-05-09 Thread Chris Eidhof
Hey everyone, I was tired of all those graphical Twitter clients that aren't usable from my Terminal, so I wrote my own. It's still very much alpha, but comments or improvements are more than welcome. You can install it by downloading the twitter-package from hackage. In order to get it

Re: [Haskell-cafe] List concat

2008-05-09 Thread Jeff Polakow
Hello, The function (++) :: [x] - [x] - [x] has O(n) complexity. If somebody were to invent some type that looks like [x] but actually uses some sort of tree rather than a linked list, you should be able to get O(1) concatenation. Has anybody ever implemented such a thing? You can also

Re: [Haskell-cafe] FFI: Creating a Storable for a C-struct composed of char arrays

2008-05-09 Thread Olivier Boudry
Hi Brandon, Thanks for your help, CString will work great for Char arrays, but what about the 16bit-Word arrays? I was not clear in my previous post but the structures used in the nwrfcsdk library can use 8bit or 16 bit chars depending on a #define (#define SAPwithUNICODE). Reading another post

Re: [Haskell-cafe] List concat

2008-05-09 Thread Jules Bean
Andrew Coppin wrote: The function (++) :: [x] - [x] - [x] has O(n) complexity. If somebody were to invent some type that looks like [x] but actually uses some sort of tree rather than a linked list, you should be able to get O(1) concatenation. Has anybody ever implemented such a thing?

Re[2]: [Haskell-cafe] FFI: Creating a Storable for a C-struct composed of char arrays

2008-05-09 Thread Bulat Ziganshin
Hello Olivier, Friday, May 9, 2008, 6:28:38 PM, you wrote: Thanks for your help, CString will work great for Char arrays, but what about the 16bit-Word arrays? TString. they are used a lot for interfacing with Win32 API -- Best regards, Bulatmailto:[EMAIL

Re: [Haskell-cafe] The Monad.Reader (11) - Call for Copy

2008-05-09 Thread Wouter Swierstra
Put them up as is, let people with haskellwiki accounts reformat them? Good idea. All the old content is now available, although some articles do look fairly horrendous: http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue2 http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue3

[Haskell-cafe] Announce: SCC, Streaming Component Combinator library

2008-05-09 Thread Mario Blazevic
I'm pleased to announce the 0.1 release of Streaming Component Combinators in Haskell, based on my earlier work done in OmniMark and published in paper Mario Blažević, Streaming component combinators, Extreme Markup Languages, 2006.

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread Brent Yorgey
On Fri, May 9, 2008 at 10:02 AM, Andrew Coppin [EMAIL PROTECTED] wrote: Darrin Thompson wrote: 2008/5/8 Donnie Jones [EMAIL PROTECTED]: I would be interested to see an article on Haskell in the same light as this Ocaml article, aka a constructive criticism of Haskell.

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread David Roundy
On Fri, May 09, 2008 at 11:35:32AM -0400, Brent Yorgey wrote: On Fri, May 9, 2008 at 10:02 AM, Andrew Coppin [EMAIL PROTECTED] wrote: While I'm here - I'm aware of how you control importing [or not] from the Prelude. Is there a way that I can, for example, import all the stuff like the

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread Andrew Coppin
Brent Yorgey wrote: On Fri, May 9, 2008 at 10:02 AM, Andrew Coppin [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: While I'm here - I'm aware of how you control importing [or not] from the Prelude. Is there a way that I can, for example, import all the stuff like the basic

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread David Roundy
On Fri, May 09, 2008 at 05:19:05PM +0100, Andrew Coppin wrote: Brent Yorgey wrote: On Fri, May 9, 2008 at 10:02 AM, Andrew Coppin [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: While I'm here - I'm aware of how you control importing [or not] from the Prelude. Is there a way

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread Andrew Coppin
David Roundy wrote: It's pretty easy (albeit tedious) to do this for yourself (except that you wouldn't automatically turn off the import of Prelude, and you'd still suffer from the instances disease). module Prelude.Types ( Int, Double, Char, String ) where import Prelude Sounds like a

[Haskell-cafe] Order of Evaluation

2008-05-09 Thread PR Stanley
Hi (take 4 . map (0)) (f s t) where s = 2 : t t = 3 : s f = zipWith (-) What would be the order of evaluation for the above code? How would I illustrate the evaluation step-by-step? I'm guessing that the code necessitates lazy evaluation and as such it starts with take then

Re: [Haskell-cafe] Order of Evaluation

2008-05-09 Thread Miguel Mitrofanov
On 9 May 2008, at 21:52, PR Stanley wrote: Hi (take 4 . map (0)) (f s t) where s = 2 : t t = 3 : s f = zipWith (-) What would be the order of evaluation for the above code? How would I illustrate the evaluation step-by-step? What do you need it for, really? Pure functional

Re: [Haskell-cafe] Order of Evaluation

2008-05-09 Thread Donnie Jones
Hello, I'm quite new to Haskell, but this is my understanding... Please correct me if I am wrong, as there is a good chance I am. ;) ### Begin Code ### module Main where main = putStrLn (show( (take 4 . map ( 0)) (f s t) )) where s = 2 : t t = 3 : s f = zipWith (-) {- -

Re: [Haskell-cafe] Order of Evaluation

2008-05-09 Thread Richard Kelsall
PR Stanley wrote: (take 4 . map (0)) (f s t) where s = 2 : t t = 3 : s f = zipWith (-) What would be the order of evaluation for the above code? As I understand it Haskell does not specify an order of evaluation and it would therefore be a mistake to write a program which relies on

Re: [Haskell-cafe] Order of Evaluation

2008-05-09 Thread Miguel Mitrofanov
As I understand it Haskell does not specify an order of evaluation and it would therefore be a mistake to write a program which relies on a particular evaluation order. This is the 'unsafe' aspect of unsafePerformIO. Hmm... IMHO unsafePerformIO is 'unsafe' because it can lead to type errors

Re: [Haskell-cafe] Induction (help!)

2008-05-09 Thread Ryan Ingram
On 5/9/08, Daniel Fischer [EMAIL PROTECTED] wrote: Right. I only wanted to say that we might have chosen the wrong base case for the proposition. If p(0) doesn't hold, then obviously [for all n. p(n)] doesn't hold. But [for all n. p(n) implies p(n+1)] could still be true, and in that case, if

Re: [Haskell-cafe] [ANN] Twitter Client

2008-05-09 Thread Gwern Branwen
On 2008.05.09 16:23:03 +0200, Chris Eidhof [EMAIL PROTECTED] scribbled 0.6K characters: Hey everyone, I was tired of all those graphical Twitter clients that aren't usable from my Terminal, so I wrote my own. It's still very much alpha, but comments or improvements are more than welcome. You

[Haskell-cafe] MonadPlus

2008-05-09 Thread Andrew Coppin
OK, so I feel I understand monads fine. I regularly use Maybe, [] and IO, and I've even constructed a few monads of my own. But here's a question: what is the purpose of the MonadPlus class? Clearly it defines a binary operation over monadic values and an identity element for that operation.

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread David Roundy
On Fri, May 09, 2008 at 08:39:38PM +0100, Andrew Coppin wrote: OK, so I feel I understand monads fine. I regularly use Maybe, [] and IO, and I've even constructed a few monads of my own. But here's a question: what is the purpose of the MonadPlus class? Clearly it defines a binary

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Rich Neswold
On Fri, May 9, 2008 at 2:39 PM, Andrew Coppin [EMAIL PROTECTED] wrote: [In a somewhat unrelated question... I saw some code the other day that used Either as if it were a monad. And yet, I don't see an instance given in the standard libraries - even though there should be one. I can see

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Bryan O'Sullivan
Andrew Coppin wrote: But here's a question: what is the purpose of the MonadPlus class? It gives you a way of working with monads as monoids. Consider a Parsec example: metasyntactic = text foo `mplus` text bar `mplus` text baz You'll get back whichever one matched, in left-to-right-order,

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Andrew Coppin
Bryan O'Sullivan wrote: Andrew Coppin wrote: But here's a question: what is the purpose of the MonadPlus class? It gives you a way of working with monads as monoids. Consider a Parsec example: metasyntactic = text foo `mplus` text bar `mplus` text baz You'll get back whichever one

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Brandon S. Allbery KF8NH
On May 9, 2008, at 15:56 , Andrew Coppin wrote: Bryan O'Sullivan wrote: Andrew Coppin wrote: But here's a question: what is the purpose of the MonadPlus class? It gives you a way of working with monads as monoids. Consider a Parsec example: metasyntactic = text foo `mplus` text bar

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Derek Elkins
On Fri, 2008-05-09 at 12:47 -0700, David Roundy wrote: On Fri, May 09, 2008 at 08:39:38PM +0100, Andrew Coppin wrote: OK, so I feel I understand monads fine. I regularly use Maybe, [] and IO, and I've even constructed a few monads of my own. But here's a question: what is the purpose of

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Bryan O'Sullivan
Andrew Coppin wrote: ...so it's a kind of choice operator? Run all actions until you get to one that succeeds and return the result from that? In the context of Parsec, yes. In the grander scheme of things, the behaviour depends on whatever is appropriate for the particular monad you're

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Derek Elkins
On Fri, 2008-05-09 at 12:48 -0700, Bryan O'Sullivan wrote: Andrew Coppin wrote: But here's a question: what is the purpose of the MonadPlus class? It gives you a way of working with monads as monoids. I find this description mostly useless. Monads form monoids without being MonadPlus.

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Nicolas Frisby
It sounds like the semantics of the MonadPlus methods are under-specified. I recall once writing a newtype wrapper to treat the same non-determinism monad with different mplus semantics, akin to cut versus backtracking. I think of MonadPlus as a less expressive version of msplit, from

Re: [Haskell-cafe] Order of Evaluation

2008-05-09 Thread PR Stanley
Hi (take 4 . map (0)) (f s t) where s = 2 : t t = 3 : s f = zipWith (-) What would be the order of evaluation for the above code? How would I illustrate the evaluation step-by-step? What do you need it for, really? Pure functional programs are not about evaluation order, but

[Haskell-cafe] unsafeInterleaveIO and OpenGL

2008-05-09 Thread Peter Verswyvelen
I'm experiencing strange behavior when executing some Haskell OpenGL code inside unsafeInterleaveIO. For example, vp - get GL.viewport returns garbage, as if the opengl context is not correctly set. Is this to be expected? Or is it likely a bug on my side? Thanks, Peter

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Dan Piponi
Andrew asked, ...so it's a kind of choice operator? Run all actions until you get to one that succeeds and return the result from that? The eternal bit of trickiness for Haskell is that type classes group often together things that people don't immediately see as similar - monads probably

Re: [Haskell-cafe] Haskell PNG Writer

2008-05-09 Thread J. Garrett Morris
As long as you don't mind producing two-color images, http://haskell.org/haskellwiki/Library/PNG is an option. I found it very easy to extend it to eight-bit grayscale - I didn't need fullcolor images. /g On Sat, May 3, 2008 at 11:12 PM, Nahuel Rullo [EMAIL PROTECTED] wrote: Hi list, i am new

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Miguel Mitrofanov
On 10 May 2008, at 00:43, Dan Piponi wrote: Andrew asked, ...so it's a kind of choice operator? Run all actions until you get to one that succeeds and return the result from that? The eternal bit of trickiness for Haskell is that type classes group often together things that people don't

Re: [Haskell-cafe] unsafeInterleaveIO and OpenGL

2008-05-09 Thread Henning Thielemann
On Fri, 9 May 2008, Peter Verswyvelen wrote: I'm experiencing strange behavior when executing some Haskell OpenGL code inside unsafeInterleaveIO. For example, vp - get GL.viewport returns garbage, as if the opengl context is not correctly set. Sounds reasonable.

[Haskell-cafe] GHC predictability

2008-05-09 Thread Jeff Polakow
Hello, One frequent criticism of Haskell (and by extension GHC) is that it has unpredictable performance and memory consumption. I personally do not find this to be the case. I suspect that most programmer confusion is rooted in shaky knowledge of lazy evaluation; and I have been able to fix,

[Haskell-cafe] (Num t) = [t] or [Int]

2008-05-09 Thread PR Stanley
Hi I thought [1, 2, 3] :: [Int] GHC says it's (Num t) [t] Okay, when it comes to 3.3:[1,2,3] (Num t) = [t] makes more sense. Is that the only reason? Cheers, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Old editions of The Monad.Reader lost

2008-05-09 Thread Gwern Branwen
On Mon, Nov 26, 2007 at 9:27 AM, Wouter Swierstra [EMAIL PROTECTED] wrote: On 18 Aug 2007, at 20:10, Henk-Jan van Tuyl wrote: Now that all hawiki pages have been removed, we have lost some valuable information. For example The Monad.Reader; on

Re: [Haskell-cafe] (Num t) = [t] or [Int]

2008-05-09 Thread Bulat Ziganshin
Hello PR, Saturday, May 10, 2008, 1:07:48 AM, you wrote: Okay, when it comes to 3.3:[1,2,3] (Num t) = [t] makes more sense. Is that the only reason? the reason is that 1 as any other numerical constant, may be directly used as Int, Integer, Double or any other Num value. if 1 is Int, you will

Re: [Haskell-cafe] Re: Interesting critique of Haskell

2008-05-09 Thread Henning Thielemann
On Fri, 9 May 2008, Andrew Coppin wrote: Brent Yorgey wrote: On Fri, May 9, 2008 at 10:02 AM, Andrew Coppin [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: While I'm here - I'm aware of how you control importing [or not] from the Prelude. Is there a way that I can, for example,

Re: [Haskell-cafe] GHC predictability

2008-05-09 Thread Don Stewart
jeff.polakow: Hello, One frequent criticism of Haskell (and by extension GHC) is that it has unpredictable performance and memory consumption. I personally do not find this to be the case. I suspect that most programmer confusion is rooted in shaky knowledge of lazy

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Dan Piponi
Miguel said: Well, that's the whole point of mathematics, isn't it? Abstraction is common to mathematics and computing. But in computing the abstraction often follows lines that seem obvious. For example a GUI library might have a Widget class and people can immediately identify various regions

[Haskell-cafe] Re: Order of Evaluation

2008-05-09 Thread Achim Schneider
Miguel Mitrofanov [EMAIL PROTECTED] wrote: As I understand it Haskell does not specify an order of evaluation and it would therefore be a mistake to write a program which relies on a particular evaluation order. This is the 'unsafe' aspect of unsafePerformIO. Hmm... IMHO

Re: [Haskell-cafe] GHC predictability

2008-05-09 Thread David Roundy
On Fri, May 09, 2008 at 02:24:12PM -0700, Don Stewart wrote: jeff.polakow: Hello, One frequent criticism of Haskell (and by extension GHC) is that it has unpredictable performance and memory consumption. I personally do not find this to be the case. I suspect that most programmer

Re: [Haskell-cafe] Re: Order of Evaluation

2008-05-09 Thread Miguel Mitrofanov
Oh, you sure? quote src=http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO-Unsafe.html It is less well known that unsafePerformIO is not type safe. For example: test :: IORef [a] test = unsafePerformIO $ newIORef [] main = do writeIORef test

[Haskell-cafe] Seeking advice on best practices with FFI

2008-05-09 Thread PJ Durai
Hello, I am trying to write FFI wrappers for a dynamic library in windows. I would like to get some help in how to go about doing things. For example for this C function, the import and wrapper I came up with are listed below. -- STATUS LNPUBLIC NSFDbOpen (char far *PathName, DBHANDLE far

[Haskell-cafe] Re: Order of Evaluation

2008-05-09 Thread Achim Schneider
Miguel Mitrofanov [EMAIL PROTECTED] wrote: Oh, you sure? I was, until you wrote that. But then, I am, as I wouldn't use unsafePerformIO together with IORef's, it's giving me the creeps. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All

Re: [Haskell-cafe] (Num t) = [t] or [Int]

2008-05-09 Thread Brandon S. Allbery KF8NH
On 2008 May 9, at 17:07, PR Stanley wrote: I thought [1, 2, 3] :: [Int] GHC says it's (Num t) [t] Okay, when it comes to 3.3:[1,2,3] (Num t) = [t] makes more sense. Is that the only reason? The Haskell 98 standard says that numeric literals are of type Num t = t (so you don't need to

Re: [Haskell-cafe] Re: Control.Exception.evaluate - 'correct definition' not so correct

2008-05-09 Thread Lennart Augustsson
GHC already ignores the existence of seq, for instance when doing list fusion. The unconstrained seq function just ruins too many things. I say, move seq top a type class (where is used to be), and add an unsafeSeq for people who want to play dangerously. -- Lennart On Tue, May 6, 2008 at 3:27

Re: [Haskell-cafe] Re: [Haskell] Re: ANN: Haddock version 2.1.0

2008-05-09 Thread Claus Reinke
Ah, I didn't think about the GHC options that change the lexical syntax. You're right, using the GHC lexer should be easier. and, if you do that, you could also make the GHC lexer squirrel away the comments (including pragmas, if they aren't already in the AST) someplace safe, indexed by, or

[Haskell-cafe] inserting values in a binary tree

2008-05-09 Thread PR Stanley
Hi data Ord a = Tree a = Nil | Node (Tree a) a (Tree a) How would one go about inserting a value in a binary search tree of the above description? Cheers Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] inserting values in a binary tree

2008-05-09 Thread Thomas Davie
On 10 May 2008, at 00:35, PR Stanley wrote: Hi data Ord a = Tree a = Nil | Node (Tree a) a (Tree a) How would one go about inserting a value in a binary search tree of the above description? All you need to do is consider what the trees should look like in the two cases: If I try and

Re: [Haskell-cafe] inserting values in a binary tree

2008-05-09 Thread Lennart Augustsson
Are there any invariants you wish to maintain when inserting? If not, it's rather trivial. -- Lennart On Fri, May 9, 2008 at 11:35 PM, PR Stanley [EMAIL PROTECTED] wrote: Hi data Ord a = Tree a = Nil | Node (Tree a) a (Tree a) How would one go about inserting a value in a binary search

[Haskell-cafe] Re: inserting values in a binary tree

2008-05-09 Thread Achim Schneider
PR Stanley [EMAIL PROTECTED] wrote: Hi data Ord a = Tree a = Nil | Node (Tree a) a (Tree a) How would one go about inserting a value in a binary search tree of the above description? Using a library ;) Inserting isn't the problem, balancing is where things get interesting: have a look at

Re: [Haskell-cafe] Re: inserting values in a binary tree

2008-05-09 Thread PR Stanley
Actually, you've touched an important point there. It's balancing that I'm having difficulty with. Paul At 23:46 09/05/2008, you wrote: PR Stanley [EMAIL PROTECTED] wrote: Hi data Ord a = Tree a = Nil | Node (Tree a) a (Tree a) How would one go about inserting a value in a binary search

Re[2]: [Haskell-cafe] inserting values in a binary tree

2008-05-09 Thread Bulat Ziganshin
Hello PR, Saturday, May 10, 2008, 3:10:59 AM, you wrote: in C you'd fiddle with pointers and Bob's your uncle. Here I'm not sure how to piece that tree back together again with the new element after having expanded it recursively. in Haskell, you just return new tree with element inserted.

Re: [Haskell-cafe] Order of Evaluation

2008-05-09 Thread Albert Y. C. Lai
Lennart Augustsson wrote: Even so, it's instructive to study how the normal order reduction of this expression would proceed under the assumption that all 4 elements will be used. I think it's useful to try normal order until weak head normal form. Not all steps are shown. Definitions of

[Haskell-cafe] ANN: Roguestar 0.2

2008-05-09 Thread Christopher Lane Hinson
website:http://roguestar.downstairspeople.org darcs 2:darcs get --lazy http://www.downstairspeople.org/darcs/roguestar tarball:http://www.downstairspeople.org/roguestar/roguestar-0.2.tar.gz After much delay, I'm happy to announce Roguestar 0.2. Roguestar is a science

[Haskell-cafe] build version problem?

2008-05-09 Thread Galchin, Vasili
Hello, I changed the version # in a cabal file and now I get ... runhaskell Setup.hs configure Configuring unix-2.4.0.0... [EMAIL PROTECTED]:~/FTP/Haskell/unix-2.2.0.0$ runhaskell Setup.hs build Setup.hs: unix.cabal has been changed, please re-configure. Now no matter what I change the

[Haskell-cafe] haskell compiler on NetBSD amd64

2008-05-09 Thread Donn Cave
So here I am with 64 bit Athlon hardware, running amd64 NetBSD (a.k.a. x86_64), reasonably motivated to compile Haskell. From what I make of the porting instructions, my only hope is to install FreeBSD-amd64 on another partition and download the 6.6.1 ghc for that platform, use it to generate .hc

[Haskell-cafe] ANN: unix-2.4.0.0 additional POSIX real time support

2008-05-09 Thread Galchin, Vasili
Hello, Additional POSIX realtime (POSIX 1003.1b) support has been added: 1) MQueue.hsc - POSIX message queues Supported FFI bindings for: - mq_open - mq_close - mq_unlink - mq_getattributes - mq_setattributes - mq_send

Re: [Haskell-cafe] ANN: unix-2.4.0.0 additional POSIX real time support

2008-05-09 Thread Don Stewart
vigalchin: Hello, Additional POSIX realtime (POSIX 1003.1b) support has been added: 1) MQueue.hsc - POSIX message queues Supported FFI bindings for: - mq_open - mq_close - mq_unlink -