Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Fraser Wilson
On Tue, Jan 12, 2010 at 11:26 PM, Daniel Fischer daniel.is.fisc...@web.dewrote: Okay, 'as' is easy. But can you find a situation where 'qualified' or 'hiding' would be natural choices for an identifier? I'd love to see those in some code :) module LordsOfMidnight.Character(Character) where

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Martin Coxall
On 12 Jan 2010, at 21:25, Andrew Coppin wrote: OK people, it's random statistics time! Haskell '98 apparently features 25 reserved words. (Not counting forall and mdo and so on, which AFAIK are not in Haskell '98.) So how does that compare to other languages? C: 32 C++: 62 Borland

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Martin Coxall
On 12 Jan 2010, at 22:22, Andrew Coppin wrote: Niklas Broberg wrote: Haskell '98 apparently features 25 reserved words. (Not counting forall and mdo and so on, which AFAIK are not in Haskell '98.) 21 actually. case, class, data, default, deriving, do, else, if, import, in, infix,

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Marc Weber
As you can see, this conclusively proves... something. What about brainfuck? 8 different signs are used. - http://de.wikipedia.org/wiki/Brainfuck#cite_note-0 The first link points to a page saying there is an interpreter 98 bytes in size.. What does this prove? :-) Marc Weber

[Haskell-cafe] Re: FASTER primes

2010-01-13 Thread Heinrich Apfelmus
Daniel Fischer wrote: Heinrich Apfelmus wrote: It is exactly because these troubles that I'm advocating the original VIP data structure that buries the dorks (that name is awesome :D) deep inside the structure. :) In fact, your transformation that fixes the space leaks pretty much emulates

[Haskell-cafe] QuickCheck: test passes in GHCi, fails when compiled

2010-01-13 Thread Lauri Pesonen
I provided a Java solution to a problem of returning the first digit of an integer on StackOverflow and someone wondered if there were any floating point point problems with the solution, so I though I'd implement the algorithm in Haskell and run QuickCheck on it. Everything works fine on GHCi,

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Ketil Malde
sylvain sylvain.na...@googlemail.com writes: Let me order your list: Smalltalk: 0 Lisp: 0 Tcl: 0 If you count reserved tokens, I guess Lisp reserves parentheses and whitespace? Haskell: 21 * Python: 31 C: 32 * JavaScript: 36 Ruby: 38 --- Borland Turbo Pascal: ~50 Java: 53

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Peter Verswyvelen
On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.netwrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although technically speaking it is possible). That said, nobody's yet to present a convincing argument to me why Java gets a free pass for

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Martin Coxall
On 13 Jan 2010, at 09:51, Peter Verswyvelen wrote: On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.net wrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although technically speaking it is possible). That said, nobody's yet to present a

[Haskell-cafe] Type Inference for Overloading without Restrictions

2010-01-13 Thread Peter Verswyvelen
A while ago, someone provided me a link to the paper Type Inference for Overloading without Restrictions http://www.dcc.ufmg.br/~camarao/ct-flops99.ps.gz Although I don't understand everything in this paper, I wander what people's opinions are about this regarding a future Haskell language

RE: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Sittampalam, Ganesh
The problem with interfaces as a replacement for type classes is that they only provide dispatch based on the specific type of the first argument (i.e. the receiver). Type classes allow you to dispatch based on return type, and on the instantiations of generic parameters. Neither of these things

[Haskell-cafe] Re: QuickCheck: test passes in GHCi, fails when compiled

2010-01-13 Thread Lauri Pesonen
2010/1/13 Lauri Pesonen lauri.peso...@iki.fi: I provided a Java solution to a problem of returning the first digit of an integer on StackOverflow and someone wondered if there were any floating point point problems with the solution, so I though I'd implement the algorithm in Haskell and run

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Sebastian Fischer
On Jan 13, 2010, at 11:00 AM, Sittampalam, Ganesh wrote: Type classes allow you to dispatch based on return type, and on the instantiations of generic parameters. Neither of these things is reasonably possible with interfaces. There is recent work that generalises the capabilities of

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 03:49 , Martin Coxall wrote: COBOL: Over 400 (!) If we're going to go that far, FORTRAN and PL/1 have none. FORTRAN is somewhat infamous for this: DO 10 I = 1, 400 is a loop start, DO 10 I = 1. 400 (note typo, . for ,) parses as the assignment DO10I = 1.400. (This

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Peter Verswyvelen
Yes that is true, but often in Haskell I had to use type annotations when the dispatch is based on the return type, so it also has some tradeoffs. Don't get me wrong, I see the advantages of Haskell's type classes and closures, and I love these. But in Java - if you stay close to OO, and don't

Re: [Haskell-cafe] Re: QuickCheck: test passes in GHCi, fails when compiled

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 05:07 , Lauri Pesonen wrote: I expect this to be a known issue with floats. Sorry for the noise. Yep. There's a faction that wants Float and Double to not be in the Eq typeclass, because floating point calculations can never reliably be compared for equality. (There

Re: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread Malcolm Wallace
But when I try to compile it (after having successfully compiled the C code with g++), I get: $ ghc --make Main.hs You are not telling ghc to link against the C/C++ code, e.g. ghc --make Main.hs srilm.o Regards, Malcolm ___ Haskell-Cafe

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Ketil Malde
Fraser Wilson blancoli...@gmail.com writes: module LordsOfMidnight.Character(Character) where data Character = C { name :: String, location :: (Int,Int), facing :: Direction, hour :: Int, energy

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Ketil Malde
Brandon S. Allbery KF8NH allb...@ece.cmu.edu writes: If we're going to go that far, FORTRAN and PL/1 have none. FORTRAN is somewhat infamous for this: There's also the option (perhaps this was PL/1?) of writing constructs like: IF THEN THEN IF ELSE THEN etc. Having few reserved words isn't

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 05:45 , Ketil Malde wrote: Brandon S. Allbery KF8NH allb...@ece.cmu.edu writes: If we're going to go that far, FORTRAN and PL/1 have none. FORTRAN is somewhat infamous for this: There's also the option (perhaps this was PL/1?) of writing constructs like: IF THEN THEN

Re: [Haskell-cafe] wildcards for type variables?

2010-01-13 Thread David Virebayre
On Wed, Jan 13, 2010 at 12:29 AM, Evan Laforge qdun...@gmail.com wrote: Occasionally I have a function with an unused argument, whose type I don't want to restrict.  Thus: f :: _unused - A - B f _ a = b I probably misunderstood the problem, why not f:: a - A - B David

Re: [Haskell-cafe] wildcards for type variables?

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 05:54 , David Virebayre wrote: On Wed, Jan 13, 2010 at 12:29 AM, Evan Laforge qdun...@gmail.com wrote: Occasionally I have a function with an unused argument, whose type I don't want to restrict. Thus: f :: _unused - A - B f _ a = b I probably misunderstood the problem,

Re: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread Bulat Ziganshin
Hello DNM, Wednesday, January 13, 2010, 8:57:45 AM, you wrote: Note: I'm relatively new to Haskell, and my knowledge of C and C++ is basically pretty minimal -- I can read, modify and compile C/C++ programs (usually). 1. you use too much unsafePerformIO. since you need newCString, i suggest

Re: [Haskell-cafe] Re: FASTER primes

2010-01-13 Thread Daniel Fischer
Am Mittwoch 13 Januar 2010 10:43:42 schrieb Heinrich Apfelmus: I wonder whether it's really the liveness of  pair  in   mergeSP (a,b) pair      = let sm = spMerge b (fst pair)        in (a ++ fst sm, merge (snd sm) (snd pair)) that is responsible for the space leak, for chances are that

Re: [Haskell-cafe] wildcards for type variables?

2010-01-13 Thread Antoine Latter
On Wed, Jan 13, 2010 at 4:59 AM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On Jan 13, 2010, at 05:54 , David Virebayre wrote: On Wed, Jan 13, 2010 at 12:29 AM, Evan Laforge qdun...@gmail.com wrote: Occasionally I have a function with an unused argument, whose type I don't want to

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Gregory Collins
Peter Verswyvelen bugf...@gmail.com writes: On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.net wrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although technically speaking it is possible). That said, nobody's yet to

Re: [Haskell-cafe] wildcards for type variables?

2010-01-13 Thread Sebastian Fischer
On Jan 13, 2010, at 2:16 PM, Antoine Latter wrote: He's looking for the self-documentation aspect of this argument is completely irrelevant. Neither rolling a random unused type variable nor foralling it (my first idea) really accomplishes that. Isn't that what we have here? a function

[Haskell-cafe] what is *hack*?

2010-01-13 Thread Günther Schmidt
Hi, References to a Hack. module came in the responses to my posts on HTML-GUIs. What is Hack then? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] what is *hack*?

2010-01-13 Thread John Van Enk
http://hackage.haskell.org/package/hack 2010/1/13 Günther Schmidt gue.schm...@web.de Hi, References to a Hack. module came in the responses to my posts on HTML-GUIs. What is Hack then? Günther ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] what is *hack*?

2010-01-13 Thread Günther Schmidt
Hi John, thanks, I should have mentioned that I had found it on hackage, I just don't understand what it *is* or what it's supposed to be for. Günther Am 13.01.10 14:46, schrieb John Van Enk: http://hackage.haskell.org/package/hack 2010/1/13 Günther Schmidt gue.schm...@web.de

Re: [Haskell-cafe] what is *hack*?

2010-01-13 Thread John Van Enk
This may help more: http://wiki.github.com/nfjinjing/hack The Hack project is based off of a project known as Rack for ruby. I'm fairly sure the documentation you can find on Rack will help you understand what Hack does. 2010/1/13 Günther Schmidt gue.schm...@web.de Hi John, thanks, I should

Re: [Haskell-cafe] what is *hack*?

2010-01-13 Thread Magnus Therning
2010/1/13 John Van Enk vane...@gmail.com: This may help more: http://wiki.github.com/nfjinjing/hack The Hack project is based off of a project known as Rack for ruby. I'm fairly sure the documentation you can find on Rack will help you understand what Hack does. Not knowing what Rack is

[Haskell-cafe] Xhtml?

2010-01-13 Thread Günther Schmidt
Hi, apologies upfront. As time presses I decided to post questions immediately as soon as I run into dead-ends. I just don't want to give the impression that I'm not willing to do my homework. I'm trying to find documentation on Xhtml, the site on hackage refers to

[Haskell-cafe] Re: Xhtml?

2010-01-13 Thread Günther Schmidt
Am 13.01.10 15:31, schrieb Günther Schmidt: Hi, apologies upfront. As time presses I decided to post questions immediately as soon as I run into dead-ends. I just don't want to give the impression that I'm not willing to do my homework. I'm trying to find documentation on Xhtml, the site on

[Haskell-cafe] Web application interface

2010-01-13 Thread Michael Snoyman
Hi, I recently read (again) the wiki page on a web application interface[1] for Haskell. It seems like this basically works out to Hack[2], but using an enumerator instead of lazy bytestring in the response type. Is anyone working on implementing this? If not, I would like to create the package,

Re: [Haskell-cafe] what is *hack*?

2010-01-13 Thread Michael Snoyman
Günther, Hack is a layer between a web application and a web server. It allows you to write a web application once and have it communicate with the server in different ways simply by swapping the handler. For example, I have applications that I test on my local system using

Re: [Haskell-cafe] Re: Xhtml?

2010-01-13 Thread minh thu
2010/1/13 Günther Schmidt gue.schm...@web.de: Am 13.01.10 15:31, schrieb Günther Schmidt: Hi, apologies upfront. As time presses I decided to post questions immediately as soon as I run into dead-ends. I just don't want to give the impression that I'm not willing to do my homework. I'm

[Haskell-cafe] Re: ssh ports for monk and nun?

2010-01-13 Thread Stefan Monnier
Trying to get ssh working via putty from behind my company firewall. My recommendation is to get access to an outside machine where you run an OpenVPN server on port 80 or 443. This will solve it once and for all. But first, please complain loudly and repeatedly about the firewall being closed

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Robert Greayer
On Wed, Jan 13, 2010 at 4:56 AM, Martin Coxall pseudo.m...@me.com wrote: On 13 Jan 2010, at 09:51, Peter Verswyvelen wrote: On Sun, Nov 1, 2009 at 2:57 AM, Gregory Collins g...@gregorycollins.net wrote: Doing OO-style programming in Haskell is difficult and unnatural, it's true (although

Re: [Haskell-cafe] wildcards for type variables?

2010-01-13 Thread Evan Laforge
Isn't that what we have here? a function of type (a - A - B) cannot use the first argument in any meaningful way. I think, he wants to document that the type variable 'a' is not used in the *type*. Yeah, that's the idea, sorry if I wasn't clear. In the case of const, I might write const ::

[Haskell-cafe] Name overloading

2010-01-13 Thread Cristiano Paris
Hi, these days I'm thinking about name scoping in Haskell and a question built up silently but steadily in my mind. Many times I see code like this: data Foo = { fooBar :: Int, fooSay :: String, fooClose :: String } which reminds me of Ye Olde Times of C where you prepend the structure name

Re: [Haskell-cafe] Name overloading

2010-01-13 Thread Bulat Ziganshin
Hello Cristiano, Wednesday, January 13, 2010, 9:43:06 PM, you wrote: coming up to my mind is that type inference actually forbids a type-directed resolution of names as in C++ or Java. you are right. we either have ad-hoc polymorphism like in C++ where type of id selected based on type of

Re: [Haskell-cafe] Name overloading

2010-01-13 Thread John Millikin
The usual suggestion I see for this sort of thing is to create a typeclass for the operations you care about[1][2]. For example: --- class HasOpen a where open :: a - Handle data DB data FS openDB :: DB -

Re[2]: [Haskell-cafe] Name overloading

2010-01-13 Thread Bulat Ziganshin
Hello John, Wednesday, January 13, 2010, 10:08:08 PM, you wrote: Of course, this doesn't allow you to have functions share the same name if they have different signatures class Open a where open :: a instance Open (Int - String) where ... instance Open (String - Int) where ... -- Best

Re: [Haskell-cafe] Name overloading

2010-01-13 Thread Edward Kmett
Well, you can get part of the way there, by using a class associated type class HasOpen a where type Open a :: * open :: a - Open a This lets you use type inference in one direction, without requiring that every result be a member of a data family. On the other hand, type inference just

Re: Re[2]: [Haskell-cafe] Name overloading

2010-01-13 Thread Edward Kmett
On Wed, Jan 13, 2010 at 2:14 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: class Open a where open :: a instance Open (Int - String) where ... instance Open (String - Int) where ... The problem with this approach is that you'll need to supply type annotations with basically

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Andrew Coppin
Colin Paul Adams wrote: Andrew It's weird that us Haskell people complain about there Andrew being only 26 letters in the alphabet Which alphabet? You have plenty of choice in Unicode. Er... I was under the impression that Haskell source code uses the ASCII character set, not

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Andrew Coppin
Marc Weber wrote: As you can see, this conclusively proves... something. What about brainfuck? 8 different signs are used. - http://de.wikipedia.org/wiki/Brainfuck#cite_note-0 The first link points to a page saying there is an interpreter 98 bytes in size.. What does this prove? :-)

Re: [Haskell-cafe] Name overloading

2010-01-13 Thread Evan Laforge
Now, in Haskell we have type inference, which is The Good Thing as it allows to validate your program at compile time. Hence, the idea coming up to my mind is that type inference actually forbids a type-directed resolution of names as in C++ or Java. Is this correct? There is a proposed

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 14:25 , Andrew Coppin wrote: Colin Paul Adams wrote: Andrew It's weird that us Haskell people complain about there Andrew being only 26 letters in the alphabet Which alphabet? You have plenty of choice in Unicode. Er... I was under the impression that Haskell source

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On Jan 12, 2010, at 17:12 , Niklas Broberg wrote: Haskell '98 apparently features 25 reserved words. (Not counting forall and mdo and so on, which AFAIK are not in Haskell '98.) 21 actually. case, class, data, default, deriving, do, else, if, import, in,

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 14:29 , Andrew Coppin wrote: Brandon S. Allbery KF8NH wrote: On Jan 12, 2010, at 17:12 , Niklas Broberg wrote: Haskell '98 apparently features 25 reserved words. (Not counting forall and mdo and so on, which AFAIK are not in Haskell '98.) 21 actually. case, class, data,

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Andrew Coppin
sylvain wrote: Le mardi 12 janvier 2010 à 21:25 +, Andrew Coppin a écrit : Hi Andrew, As you can see, this conclusively proves... something. What, exactly? Not a lot. As you so elegantly point out, the number of keywords in a language is a fairly crude measurement of how

[Haskell-cafe] What is the difference between Strachey diff from Scott Semantic Domain?

2010-01-13 Thread Daryoush Mehrtash
On Stack overflow page Conal Elliot says: Beware that denotational semantics has two parts, from its two founders Christopher Strachey and Dana Scott: the easier more useful Strachey part and the harder and less useful (for design) Scott part.

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On Jan 13, 2010, at 14:29 , Andrew Coppin wrote: Brandon S. Allbery KF8NH wrote: Are we counting the FFI annex (foreign)? Strictly, wasn't that added *after* the Haskell 98 report was written? I.e., if you wanted to be ultra-technical about it, it's not part

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Andrew Coppin
Brandon S. Allbery KF8NH wrote: On Jan 13, 2010, at 14:25 , Andrew Coppin wrote: Colin Paul Adams wrote: Andrew It's weird that us Haskell people complain about there Andrew being only 26 letters in the alphabet Which alphabet? You have plenty of choice in Unicode. Er... I was under

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Miguel Mitrofanov
On 13 Jan 2010, at 22:25, Andrew Coppin wrote: Colin Paul Adams wrote: Andrew It's weird that us Haskell people complain about there Andrew being only 26 letters in the alphabet Which alphabet? You have plenty of choice in Unicode. Er... I was under the impression that Haskell

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Sebastian Sylvan
On Wed, Jan 13, 2010 at 12:55 AM, Eduard Sergeev eduard.serg...@gmail.comwrote: Andrew Coppin wrote: OK people, it's random statistics time! OK, my version of meaningless statistics: C++ (ISO/IEC 14882:1998(E)): 325 pages (712 including standard libraries) C# (ECMA-334): 505 pages

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 14:42 , Andrew Coppin wrote: Brandon S. Allbery KF8NH wrote: On Jan 13, 2010, at 14:25 , Andrew Coppin wrote: Colin Paul Adams wrote: Andrew It's weird that us Haskell people complain about there Andrew being only 26 letters in the alphabet Which alphabet? You have

Re: [Haskell-cafe] wildcards for type variables?

2010-01-13 Thread Sebastian Fischer
On Jan 13, 2010, at 6:54 PM, Evan Laforge wrote: It's not a big issue, but it seemed like a nice symmetry with pattern matching syntax. And I don't think it's a weird idea. The Haskell dialect Curry [1] supports this syntax. Maybe the hurdle for Haskell is the competition with more

Re: [Haskell-cafe] Re: what is *hack*?

2010-01-13 Thread Pasqualino Titto Assini
Hi Michael, what is your experience with hack? Do you have any problem moving your apps from one server/env to another? Regards, titto 2010/1/13 Günther Schmidt gue.schm...@web.de: Hi Michael, on first impression this seems like a good idea then. Günther Am 13.01.10 15:48,

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Tom Tobin
On Wed, Jan 13, 2010 at 1:28 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On Jan 13, 2010, at 14:25 , Andrew Coppin wrote: (And even if that's not the case, I've yet to find a way to type in the Unicode characters which are hypothetically possible.) That's a problem with your

Re: [Haskell-cafe] Re: what is *hack*?

2010-01-13 Thread Alberto G. Corona
rack (and hack) permits also to concatenate applications (request handlers) one in top of the other. with interesting combinations (filters, encriptation layers, applications as such). It seems that this is the reason for its name. At first sight it seems too little code to make something useful,

Re: [Haskell-cafe] Re: what is *hack*?

2010-01-13 Thread Michael Snoyman
Titto, I've had no problems with hack. The only things to keep in mind are outside the scope of hack such as: * Persistence. Clearly you need to optimize your application different for CGI run (load up only what you need right now) versus long-running processes like FastCGI (load data only

Re: [Haskell-cafe] ghc -e

2010-01-13 Thread Henning Thielemann
On Wed, 6 Jan 2010, Gwern Branwen wrote: On Wed, Jan 6, 2010 at 7:23 PM, Tony Morris tonymor...@gmail.com wrote: ghc -e import Control.Monad; forM [[1,2,3]] reverse As of 6.10.2, the bug whereby the GHC API lets you use functions from anywhere just by naming them (Java-style) has not been

Re: [Haskell-cafe] Re: looking for origin of quote on preprocessors and language design

2010-01-13 Thread Henning Thielemann
Maciej Piechotka schrieb: Not quite. While I agree that the *frequent* need for a preprocessor shows omissions in (the design of) a language. it is not necessary the case. Preprocessor may be useful if: - there is a new beatyful feature in newer version of compiler but you still want to have

[Haskell-cafe] Re: status of wash?

2010-01-13 Thread Günther Schmidt
Hi, well I followed klondykes advise and followed through with the examples on the http://www.haskell.org/haskellwiki/Practical_web_programming_in_Haskell site. The authors did point out at the very beginning that the approach shown was not very sophisticated and I'd agree with that :) .

Re: [Haskell-cafe] Re: looking for origin of quote on preprocessors and language design

2010-01-13 Thread Maciej Piechotka
On Wed, 2010-01-13 at 22:42 +0100, Henning Thielemann wrote: Maciej Piechotka schrieb: Not quite. While I agree that the *frequent* need for a preprocessor shows omissions in (the design of) a language. it is not necessary the case. Preprocessor may be useful if: - there is a new

Re: [Haskell-cafe] looking for origin of quote on preprocessors and language design

2010-01-13 Thread John Millikin
Haskell doesn't *need* preprocessors, but they sure make a lot of things easier. There are three I use regularly (c2hs, cpphs, noweb), and each serves a purpose which isn't directly supported by plain Haskell: c2hs -- Supports generating foreign function imports and wrappers based on C header

Re: [Haskell-cafe] How to fulfill the code-reuse destiny of OOP?

2010-01-13 Thread Martin Coxall
Anonymous classes in Java close over their lexical environment (can refer to variables in that lexical environment, with values bound at the time of instance construction) with the caveat that only local variables/parameters marked as 'final' may be referred to. Aside from the horrible

Re: [Haskell-cafe] Web application interface

2010-01-13 Thread Jinjing Wang
The hyena backend is essentially just a translator between hack and wai, i failed to finished it since I can't understand iteratee (seriously) and eventually got distracted ... What hyena tries to solve can't be realized in hack, so there's not too much reason for a backend anyway. Hyena is

Re: [Haskell-cafe] space leaks and optimizations

2010-01-13 Thread Ryan Ingram
On Sat, Jan 9, 2010 at 2:23 AM, Alexei Kitaev kit...@iqi.caltech.edu wrote: Reading the discussion related to your blog, I realized that strict State is different in that it does not actually force the state. But forcing can be achieved by wrapping all actions with the following function:

Re: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread DNM
Bulat, Some very good suggestions. I will try to appease Ceiling Cat and reduce my (perhaps gratuitous) use of unsafePerformIO. I'm going to have to use it somewhere, since I want referentially transparent code (and I try to avoid the IO monad when possible, anyway). 2. if your function

Re: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread DNM
Malcolm, I saw this suggestion somewhere else. Unfortunately, it didn't help either. I still get the undefined reference errors. I did eventually get ghc to compile Main.hs by putting the -c and -cpp flags after --make Main.hs. Then it produces a Main.o file which (even with +x permissions on

Re: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread DNM
Sorry. In my haste to paste in the .c file, I left out all the include statements. I do have #include srilm.h there (which to my non- C/C++ mind seems stupid -- why the hell would you need to import the header file for the code that it's a header *for*?) Still no dice. Thanks for your time,

Re: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread Brandon S. Allbery KF8NH
On Jan 13, 2010, at 23:28 , DNM wrote: Sorry. In my haste to paste in the .c file, I left out all the include statements. I do have #include srilm.h there (which to my non- C/C++ mind seems stupid -- why the hell would you need to import the header file for the code that it's a header

Re: [Haskell-cafe] Language simplicity

2010-01-13 Thread Colin Paul Adams
Tom == Tom Tobin korp...@korpios.com writes: Tom readability. The ASCII characters are universal and easily Tom recognized No they are not. My wife is Chinese. When she was learning pinyin as a child, she asked her father for help with some homework. He replied that he didn't

[Haskell-cafe] Strategies

2010-01-13 Thread Alexei Kitaev
Dear Ryan, Thanks a lot for your support and for pointing out a problem with my approach to forcing the state. I was aware of this issue but I didn't know there was a standard solution. It is indeed very natural to let each type specify how to evaluate itself. I will try this technique on the

[Haskell-cafe] Re: FASTER primes

2010-01-13 Thread Will Ness
Daniel Fischer daniel.is.fischer at web.de writes: Am Mittwoch 13 Januar 2010 10:43:42 schrieb Heinrich Apfelmus: I wonder whether it's really the liveness of  pair  in   mergeSP (a,b) pair      = let sm = spMerge b (fst pair)        in (a ++ fst sm, merge (snd sm) (snd pair))

Re[2]: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread Bulat Ziganshin
Hello DNM, Thursday, January 14, 2010, 7:07:43 AM, you wrote: Yes, I thought of doing this, but then thought it was better to use a so-called managed foreign pointer via newForeignPtr. i recommend to use Ptr and switch to ForeignPtr only when you will study how to use it. overall, unsafe*

Re[2]: [Haskell-cafe] FFI, C/C++ and undefined references

2010-01-13 Thread Bulat Ziganshin
Hello Brandon, Thursday, January 14, 2010, 7:40:45 AM, you wrote: Really, the only reason in this case is that there is no equivalent for `extern C' that you can apply to a function definition, only to a declaration it works with GCC: extern C int c_szOpenArchive (TABI_ELEMENT* params) {