Re: [Haskell-cafe] [Off topic] Proving an impossibility

2007-09-04 Thread Miguel
On 9/3/07,Vimal[EMAIL PROTECTED] wrote: while E do S if F then break end T end He then asked us to *prove* that the above programming fragment cannot be implemented just using if and while statement, even if S and T can be duplicated a finite number of times But it IS possible. Just add a

[Haskell-cafe] Re: FFI and DLLs

2007-09-04 Thread Simon Marlow
Lewis-Sandy, Darrell wrote: An early proposal for the FFI supported importing functions directly from dynamic link libraries: www.*haskell*.org/hdirect/ffi-a4.ps.gz http://www.haskell.org/hdirect/ffi-a4.ps.gz This looks like it was dropped from the final version of the addendum in favor of

Re: [Haskell-cafe] Serial Communications in Haskell

2007-09-04 Thread Mitar
Hi! You can check how I did this in my Lego Mindstorms NXT interface, pre-beta version: http://www.forzanka.si/files/NXT.tgz That's really cool! I hope you can upload this to hackage soon. I do not think it is ready yet. It is working but it is missing extensive testing (making some

Re: [Haskell-cafe] Re: [Off topic] Proving an impossibility

2007-09-04 Thread Brandon S. Allbery KF8NH
On Sep 4, 2007, at 5:02 , Miguel Mitrofanov wrote: It depends on arbitrary restrictions on what constitutes an (boolean) expression, something that is anathema to functional programmers :-) Spot the language: while if E then S; F else False fi do T od It reminds me of a

Re: [Haskell-cafe] Installation of GLUT package

2007-09-04 Thread Paul L
On 9/4/07, Sven Panne [EMAIL PROTECTED] wrote: But coming to the main point: I can't see a reason why the GLUT package needs to be rebuilt, it gets the freeglut-specific API entries dynamically (at least, that was the plan ;-). Replacing the original GLUT DLL with the freeglut DLL should work.

[Haskell-cafe] Re: [Off topic] Proving an impossibility

2007-09-04 Thread Jon Fairbairn
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes: On Sep 4, 2007, at 5:02 , Miguel Mitrofanov wrote: It depends on arbitrary restrictions on what constitutes an (boolean) expression, something that is anathema to functional programmers :-) Spot the language: while if E then S; F

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-04 Thread Peter Verswyvelen
Henning Thielemann wrote: If you are happy with writing do {1;2;3;4} you are certainly also happy with cv [1,2,3,4], where cv means 'convert' and is a method of a class for converting between lists and another sequence type. class ListCompatible lc where cv :: [a] - lc a rt :: lc a - [a]

Re: [Haskell-cafe] Re: [Off topic] Proving an impossibility

2007-09-04 Thread Vimal
I hadn't interpreted the reminding of Knuth that way. I wouldn't count break as a goto -- what makes goto especially nasty is that the destination isn't indicated by the structure of the source; it could be just anywhere. Break is slightly more structured. Maybe you might need to take a

Re: [Haskell-cafe] Re: [Off topic] Proving an impossibility

2007-09-04 Thread Tillmann Rendel
Vimal wrote: Ah, yes, it is possible in this case, but you have used an extra variable. It is okay, but our professor doesnt want to put emphasis on Computability here (or maybe I dont realize it), but the point is: Are such programming constructs really necessary in a programming language? i.e.

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-04 Thread Jonathan Cast
On Tue, 2007-09-04 at 16:06 +0200, Peter Verswyvelen wrote: Henning Thielemann wrote: If you are happy with writing do {1;2;3;4} you are certainly also happy with cv [1,2,3,4], where cv means 'convert' and is a method of a class for converting between lists and another sequence type.

[Haskell-cafe] Re: Code from Why Functional Programming Matters

2007-09-04 Thread Rene de Visser
Andrew Wagner [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] current position (or, even more ideally, the so-called principal variation, which is the best series of moves from the current position). Is there a good way to collect this, without mapping some sort of function

Re: [Haskell-cafe] Installation of GLUT package

2007-09-04 Thread Sven Panne
On Tuesday 04 September 2007 15:37, Paul L wrote: The detection of freeglut or glut is at compile time by checking if some function exists. Otherwise it's not able to link. So you'll have to re-compile the Haskell GLUT package. Show me the code where the alleged tests are made, please... :-)

[Haskell-cafe] Request for code review - Knuth Morris Pratt for Data.Sequence

2007-09-04 Thread Justin Bailey
Using the code developed for ByteStrings by myself, Christ Kuklewicz and Daniel Fischer, I've implemented Knuth-Morris-Pratt substring searching on Data.Sequence Seq values. Attached you'll find the library in kmp.zip.safe. The algorithm is implemented in the module Data.Sequence.KMP. At the

Re: [Haskell-cafe] Installation of GLUT package

2007-09-04 Thread Paul L
hs_GLUT_getProcAddress in cbits/HsGLUT.c apparently requires FREEGLUT or GLUT_API_VERSION = 5 or OPENGLUT to be defined at compile time in order to work, as the standard GLUT 3.7 doesn't even have the glutGetProcAddress(..) function. Regards, Paul Liu On 9/4/07, Sven Panne [EMAIL PROTECTED]

Re: [Haskell-cafe] [Off topic] Proving an impossibility

2007-09-04 Thread Dan Piponi
On 9/3/07, Vimal [EMAIL PROTECTED] wrote: Hi In my Paradigms of Programming course, my professor presents this piece of code: while E do S if F then break end T end This is seriously offtopic but kinda fun anyway... There's a nice formalism for investigating this kind of

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-04 Thread Peter Verswyvelen
Jonathan Cast wrote: I don't think this has been mentioned explicitly yet, but the discrepancy is purely for pedagogical purposes. In Gofer, list comprehensions (and list syntax, IIRC) /was/ generalized (to an arbitrary instance of MonadPlus). But that means that any mistake in your syntax

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-04 Thread Jonathan Cast
On Tue, 2007-09-04 at 23:03 +0200, Peter Verswyvelen wrote: Jonathan Cast wrote: I don't think this has been mentioned explicitly yet, but the discrepancy is purely for pedagogical purposes. In Gofer, list comprehensions (and list syntax, IIRC) /was/ generalized (to an arbitrary

[Haskell-cafe] Elevator pitch for Haskell.

2007-09-04 Thread Paul Johnson
This page (http://www.npdbd.umn.edu/deliver/elevator.html) has a template for an elevator pitch. This is what you say to someone when you have 30 seconds to explain your big idea, for instance if you find yourself in an elevator with them. I thought I'd try instantiating it for Haskell.

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

2007-09-04 Thread Michael Vanier
It's very nice, but I would say that anyone who needs an elevator pitch shouldn't be using or working with Haskell. Haskell is for people who already get it. I've had job offers from people just because they knew I _liked_ Haskell, even though they weren't asking me to use it for the job.

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

2007-09-04 Thread David Pollak
Paul, It's a good start, but it's a little too feature oriented rather than benefits oriented. Features: makes programmers more productive, allows projects to grow larger, allows maintenance teams to pick up the code with less skills xfer, faster time to market and faster and more reliable

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

2007-09-04 Thread Greg Fitzgerald
Paul, This page (http://www.npdbd.umn.edu/deliver/elevator.html) has a template for an elevator pitch. I thought I'd try instantiating it for Haskell. For software developers who need to produce highly reliable software at minimum cost... Looks like a good pitch for developers. Here's my

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

2007-09-04 Thread Dan Weston
And here's my guide for public health officials... WARNING: Learning Haskell is dangerous to your health! Disguised as a fully-functional programming language, Haskell is actually a front for a working math-lab, supported by a cult of volunteers seeking to ensnare weak-headed but normal

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

2007-09-04 Thread Michael Vanier
Awesome! I'm reminded of the IRC post that said that Haskell is bad, it makes you hate other languages. Mike Dan Weston wrote: And here's my guide for public health officials... WARNING: Learning Haskell is dangerous to your health! Disguised as a fully-functional programming language,

[Haskell-cafe] ANNOUNCE: xmonad 0.3

2007-09-04 Thread Donald Bruce Stewart
The xmonad dev team is pleased to announce the 0.3 release of xmonad. xmonad: a tiling window manager http://xmonad.org About: xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap,

Re: [Haskell-cafe] Learn Prolog...

2007-09-04 Thread Thomas Conway
On 9/2/07, Andrew Coppin [EMAIL PROTECTED] wrote: One of standard exercices in Prolog is the construction of the meta-interpreter of Prolog in Prolog. While this is cheating, I recommend it to you. It opens eyes. Ever tried implementing Haskell in Haskell? ;-) In many respects, Haskell

[Haskell-cafe] About mplus

2007-09-04 Thread ok
I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy mzero `mplus` x = x x `mplus` mzero = x mzero = f = mzero v mzero = mzero but is that all

Re: [Haskell-cafe] Learn Prolog...

2007-09-04 Thread Derek Elkins
On Wed, 2007-09-05 at 13:21 +1000, Thomas Conway wrote: On 9/2/07, Andrew Coppin [EMAIL PROTECTED] wrote: One of standard exercices in Prolog is the construction of the meta-interpreter of Prolog in Prolog. While this is cheating, I recommend it to you. It opens eyes. Ever tried

Re: [Haskell-cafe] Learn Prolog...

2007-09-04 Thread Stefan O'Rear
On Wed, Sep 05, 2007 at 01:21:52PM +1000, Thomas Conway wrote: but to interpret this as a *program* you have to consider how it will be executed. In particular, using SLD resolution, conjunction (/\, or ',' in Prolog notation) is not commutative as it is in predicate logic. I've always

Re: [Haskell-cafe] About mplus

2007-09-04 Thread Stefan O'Rear
On Wed, Sep 05, 2007 at 03:35:03PM +1200, ok wrote: I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy mzero `mplus` x = x x `mplus` mzero = x mzero = f =

Re: [Haskell-cafe] Re: [Off topic] Proving an impossibility

2007-09-04 Thread Sterling Clover
You get the logic and code blowup problems that require either local variables, breaks, gotos, or continuations because you're working with tests that generate side-effects. Mixing side-effects and tests is going to generate a goto, sure, but if the code was rewritten in a functional style

Re: [Haskell-cafe] Extending the idea of a general Num to other types?

2007-09-04 Thread Sterling Clover
On Sep 4, 2007, at 5:03 PM, Peter Verswyvelen wrote: Otherwise you would need a very clever compiler/editor machine learning system, that looks at how a class of users fixes a certain error, so the compiler can adapt its error message the next time a similar pattern occurs (which is

Re: [Haskell-cafe] Learn Prolog...

2007-09-04 Thread Thomas Conway
On 9/5/07, Derek Elkins [EMAIL PROTECTED] wrote: That's because Prolog is -ugly-. The only reason I recommend it is because it's archetypical and there aren't any other logic languages with anywhere near the mindshare/significance. For a thing of sheer beauty, see, e.g. LolliMon. Oh, look,

Re: [Haskell-cafe] Learn Prolog...

2007-09-04 Thread Thomas Conway
On 9/5/07, Stefan O'Rear [EMAIL PROTECTED] wrote: I've always wondered why Prolog uses DFS, instead of some complete method like DFID or Eppstein's hybrid BFS... having to worry about clause order seems so out of place. Well, a couple of reasons are pretty well agreed in the Prolog community:

Re: [Haskell-cafe] About mplus

2007-09-04 Thread David Benbennick
On 9/4/07, ok [EMAIL PROTECTED] wrote: I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy mzero `mplus` x = x x `mplus` mzero = x mzero = f = mzero

[Haskell-cafe] ANN: Finance-Quote-Yahoo 0.3

2007-09-04 Thread brad clawsie
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Finance-Quote-Yahoo-0.3 i know minor point releases do not merit a list announcement but yahoo discontinued a url i was using to download data, so users of this package must upgrade. sorry for the hassle. thanks brad