[Haskell-cafe] Re: [Haskell] ANNOUNCE: HStringTemplate -- An Elegant, Functional, Nifty Templating Engine for Haskell

2008-01-14 Thread Don Stewart
s.clover: HStringTemplate is a port of Terrence Parr’s lovely StringTemplate (http://www.stringtemplate.org) engine to Haskell. It is available, cabalized, at: darcs get http://code.haskell.org/HStringTemplate/ Looks very useful! Will this be on hackage.haskell.org soon? I can't wait

Re: [Haskell-cafe] All equations must have the same arity - why?

2008-01-14 Thread Lennart Augustsson
There is no technical reason for this. It's a matter of taste. As someone else pointed out, different arities is usually a bug. -- Lennart On Jan 13, 2008 3:12 PM, Neil Mitchell [EMAIL PROTECTED] wrote: Hi, It's nice to write functions in point free style: f = sort . nub But

RE: [Haskell-cafe] Possibility to port vshaskell to VS2008?

2008-01-14 Thread Simon Peyton-Jones
Yes, the VS Shell indeed looks an attractive platform, because it's free. It'd be great if someone wanted to port Visual Haskell to the VS Shell. Simon | -Original Message- | From: Peter Verswyvelen | Sent: 13 January 2008 21:15 | Subject: Re: [Haskell-cafe] Possibility to port

RE: [Haskell-cafe] Possibility to port vshaskell to VS2008?

2008-01-14 Thread Peter Verswyvelen
Yes, would be really nice. And in the meanwhile update it to GHC 6.8.2 and add support for debugging/stepping now that GHC supports it :-) Peter On Mon, 2008-01-14 at 08:45 +, Simon Peyton-Jones wrote: Yes, the VS Shell indeed looks an attractive platform, because it's free. It'd be

[Haskell-cafe] Code folding in Emacs

2008-01-14 Thread Johan Tibell
It would be pretty neat for Haskell hacking if the Emacs Haskell mode could do the following. Imagine you have written some code like so: -- | The parse state. data S = S {-# UNPACK #-} !B.ByteString -- current chunk L.ByteString -- rest of the input {-#

Re: [Haskell-cafe] Computer Science Books using Haskell

2008-01-14 Thread jerzy . karczmarczuk
Don Stewart writes: One textbook on algorithms with a functional approach is by Fethi Rabhi and Guy Lapalme: Algorithms: A functional programming approach published by Addison-Wesley, 235 pages, ISBN 0-201-59604-0 I'd imagine they wouldn't use many OCR unfriendly characters. I perhaps

Re: [Haskell-cafe] How to add ENV variable in runhaskell shell script

2008-01-14 Thread John Meacham
only one argument is allowed after the #! on the first line. however the following should be portable if you must set the variable before runhaskell is executed: #!/bin/sh -- /dev/null 21; MYENV=foo runhaskell $_ import System.Environment main = getEnv MYENV = print -- John Meacham -

Re: [Haskell-cafe] All equations must have the same arity - why?

2008-01-14 Thread Bulat Ziganshin
Hello Neil, Monday, January 14, 2008, 2:12:52 AM, you wrote: But sometimes I have to add an extra case, on a certain value: f [] = [1] f = sort . nub Is there a reason this isn't done? this may be also due an error, and in most cases it actually will be due an error. then it makes type

Re: [Haskell-cafe] Code folding in Emacs

2008-01-14 Thread Valery V. Vorotyntsev
On 1/14/08, Johan Tibell [EMAIL PROTECTED] wrote: It would be pretty neat for Haskell hacking if the Emacs Haskell mode could do the following. Imagine you have written some code like so: [...] Binding a haskell-fold-source function to a key chain would enable you to get a quick overview of

[Haskell-cafe] Re: [newbie question] Memoization automatic in Haskell?

2008-01-14 Thread Stephane Bortzmeyer
On Sun, Jan 13, 2008 at 12:25:53AM +0100, Henning Thielemann [EMAIL PROTECTED] wrote a message of 28 lines which said: Caching is not the default, but you can easily code this by yourself: Define an array and initialize it with all function values. Because of lazy evaluation the function

[Haskell-cafe] Re: Code folding in Emacs

2008-01-14 Thread Joe Buehler
Johan Tibell wrote: Anyone with strong Emacs-fu that knows how one could implement such a function? This looks like a straightforward application of outline mode. I believe it might be as simple as setting up a regex and enabling the mode, but check the LISP source for outline mode or

Re: [Haskell-cafe] [IETF Apps meeting] A Theory of Templating Languages

2008-01-14 Thread Mario Blazevic
I did find one paper that makes a start at such work, Enforcing Strict Model-View Separation in Template Engines, but the theory is a little weak and it focuses on the nebulous idea of separation of model and view, as opposed to a classification of capabilities and limitations. When I did

Re: [Haskell-cafe] Code folding in Emacs

2008-01-14 Thread Johan Tibell
On Jan 14, 2008 2:30 PM, Valery V. Vorotyntsev [EMAIL PROTECTED] wrote: On 1/14/08, Johan Tibell [EMAIL PROTECTED] wrote: It would be pretty neat for Haskell hacking if the Emacs Haskell mode could do the following. Imagine you have written some code like so: [...] Binding a

[Haskell-cafe] Re: All equations must have the same arity - why?

2008-01-14 Thread Achim Schneider
Jonathan Cast [EMAIL PROTECTED] wrote: On 13 Jan 2008, at 5:49 PM, Achim Schneider wrote: Jonathan Cast [EMAIL PROTECTED] wrote: On 13 Jan 2008, at 5:27 PM, Achim Schneider wrote: Answer #2: Because you can't write f x = case x of [] - [1] - sort.nub But why

Re: [Haskell-cafe] Re: 0/0 1 == False

2008-01-14 Thread David Roundy
On Fri, Jan 11, 2008 at 07:10:20PM -0800, Jonathan Cast wrote: On 11 Jan 2008, at 10:12 AM, Achim Schneider wrote: David Roundy [EMAIL PROTECTED] wrote: Prelude let x=1e-300/1e300 Prelude x 0.0 Prelude x/x NaN The true answer here is that x/x == 1.0 (not 0 or +Infinity), but there's

Re: [Haskell-cafe] Computer Science Books using Haskell

2008-01-14 Thread Bryan O'Sullivan
PR Stanley wrote: Can the list recommend books that use Haskell - or any FP language but preferably Haskell - to illustrate the principles of compilers and/or algorithms? Try Andrew Appel's Modern Compiler Implementation in ML http://www.cs.princeton.edu/~appel/modern/ml/ which, as it uses

[Haskell-cafe] cabal and hpc?

2008-01-14 Thread Greg Fitzgerald
Has the Haskell Program Coverage tool been integrated into Cabal? That is, is there anything like runhaskell Setup.hs coverage to generate a coverage report? Thanks, Greg ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] cabal and hpc?

2008-01-14 Thread Don Stewart
garious: Has the Haskell Program Coverage tool been integrated into Cabal? That is, is there anything like runhaskell Setup.hs coverage to generate a coverage report? Not yet, but definitely on the todo list (its a variant of the test target, that would add -fhpc to each compile, so

Re: [Haskell-cafe] Getting frantic with FranTk

2008-01-14 Thread Justin Bailey
On Jan 13, 2008 5:54 AM, Torsten Otto [EMAIL PROTECTED] wrote: Howdy, with a just-in-time-learning approach I managed to teach my class of advanced high schoolers the basics of functional programming using Haskell (I had only used Scheme before). Now to show them that Haskell That is

Re: [Haskell-cafe] Yi editor tutorial

2008-01-14 Thread gwern0
On 2008.01.14 13:34:42 +, Andrew Birkett [EMAIL PROTECTED] scribbled 0.8K characters: [EMAIL PROTECTED] wrote: I'm going through them now, and I like them a lot. (Maybe I'll finally begin doing stuff with Yi!) Is there any particular reason you didn't put your tutorials on the Haskell

Re: [Haskell-cafe] Re: MonadPrompt + Gtk2Hs = ?

2008-01-14 Thread Felipe Lessa
On Jan 13, 2008 6:49 PM, apfelmus [EMAIL PROTECTED] wrote: K. Claessen. Poor man's concurrency monad. http://www.cs.chalmers.se/~koen/pubs/jfp99-monad.ps P. Li, S. Zdancewic. Combining events and threads for scalable network services.

[Haskell-cafe] Strange GLFW linker problem on Linux

2008-01-14 Thread Peter Verswyvelen
Because apparently GHC works much better on Linux than Windows, I switched to that platform. I'm currently trying Fedora 8. So now I'm completely alone in the dark: no experience with Haskell, no experience with Linux; I left decades of experience with Microsoft products behind me ;-) I tried

[Haskell-cafe] First Israel Haskell Event

2008-01-14 Thread B K
Hello all, A Haskell gathering will take place for the first time in Israel: Friday, January 18 2008 at 11:00 AM Village Green, 33 Jaffa Rd, (corner of Rivlin St), Jerusalem This will be an informal event where everyone can introduce themselves and talk about their thoughts on Haskell. Everyone

[Haskell-cafe] Re: Strange GLFW linker problem on Linux

2008-01-14 Thread Achim Schneider
Peter Verswyvelen [EMAIL PROTECTED] wrote: Any hints? Look at ghc --make -v and make sure that ghc uses the right -l and -L options when it calls the linker. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved.

Re: [Haskell-cafe] Getting frantic with FranTk

2008-01-14 Thread Torsten Otto
Thank you for the encouragement, Justin. Unfortunately I did try that. But it may also be where my basic understanding is missing: the libraries - do I have to somehow compile all the source or can I just use it? The source is Haskell, but it all comes with makefiles - are these for use

[Haskell-cafe] Haskell and GUI

2008-01-14 Thread Torsten Otto
Seeing my woes with FranTk - what else is out there that people use if a (simple) GUI is desired for a Haskell app? Just a few textboxes and a button or two would do me. Thanks in advance! Regards, Torsten ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Haskell and GUI

2008-01-14 Thread Neil Mitchell
Hi Torsten, Seeing my woes with FranTk - what else is out there that people use if a (simple) GUI is desired for a Haskell app? Just a few textboxes and a button or two would do me. Gtk2hs in GHC: http://www.haskell.org/gtk2hs/ Thanks Neil ___

Re: [Haskell-cafe] Getting frantic with FranTk

2008-01-14 Thread Duncan Coutts
On Sun, 2008-01-13 at 14:54 +0100, Torsten Otto wrote: Howdy, with a just-in-time-learning approach I managed to teach my class of advanced high schoolers the basics of functional programming using Haskell (I had only used Scheme before). Now to show them that Haskell is not a weirdo

[Haskell-cafe] Re: MonadPrompt + Gtk2Hs = ?

2008-01-14 Thread apfelmus
Felipe Lessa wrote: apfelmus wrote: Oh, what kind of generalization do you have in mind? Leaking Prompt(..) in the export list to the GUI code seems wrong to me, I like 'runPromptM' because it hides the Prompt(..) data type from the user [module]. But after some rest I think I found a nice

[Haskell-cafe] Re: Re: Displaying # of reductions after eachcomputation in ghci?

2008-01-14 Thread Ben Franksen
Lennart Augustsson wrote: What is a reduction anyway? I am not an expert but I thought in lambda calculus one has primitive rules for evaluation, e.g. beta reduction. So a reduction is a 'smallest step' in reducing an expression to normal form, no? Cheers Ben

Re: [Haskell-cafe] Haskell and GUI

2008-01-14 Thread Sebastian Sylvan
On Jan 14, 2008 10:09 PM, Torsten Otto [EMAIL PROTECTED] wrote: Seeing my woes with FranTk - what else is out there that people use if a (simple) GUI is desired for a Haskell app? Just a few textboxes and a button or two would do me. Thanks in advance! I like wxHaskell. It seems that

[Haskell-cafe] Re: Displaying # of reductions after eachcomputation in ghci?

2008-01-14 Thread apfelmus
Ben Franksen wrote: Lennart Augustsson wrote: What is a reduction anyway? I am not an expert but I thought in lambda calculus one has primitive rules for evaluation, e.g. beta reduction. So a reduction is a 'smallest step' in reducing an expression to normal form, no? Yes and no, a single

Re: [Haskell-cafe] QuickCheck properties: export or not?

2008-01-14 Thread Don Stewart
paul: I was recently sent a patch for my Ranged Sets library which exported all the QuickCheck properties. I'd left them unexported on the grounds that they clutter up the documentation (although simplified versions are included in the documentation) and you can easily run them with the

[Haskell-cafe] Re: Why purely in haskell?

2008-01-14 Thread Ben Franksen
[EMAIL PROTECTED] wrote: Wolfgang Jeltsch wrote: My impression is that staying close to math is good from a software technology point of view. And it has the advantage of less confusion for the user. What does it mean close to math? How close? Does math raise exceptions upon the division

[Haskell-cafe] QuickCheck properties: export or not?

2008-01-14 Thread Paul Johnson
I was recently sent a patch for my Ranged Sets library which exported all the QuickCheck properties. I'd left them unexported on the grounds that they clutter up the documentation (although simplified versions are included in the documentation) and you can easily run them with the standard

Re: [Haskell-cafe] QuickCheck properties: export or not?

2008-01-14 Thread Don Stewart
ndmitchell: Hi standard quickcheck script. The contributor, [EMAIL PROTECTED] suggested an explicit test harness instead. Unless you have a test harness (ideally through Cabal), the properties will go out of sync, and you'll forget to run them. Tests are good, they should be able to

[Haskell-cafe] Re: Why purely in haskell?

2008-01-14 Thread Achim Schneider
[EMAIL PROTECTED] wrote: When math says that something is undefined, in my little brain I understand that there is no answer. NO answer. Math doesn't say that something is undefined, but tells you that you did something that's illegal, i.e. impossible, in the system you're working with.

[Haskell-cafe] Re: Why purely in haskell?

2008-01-14 Thread jerzy . karczmarczuk
Ben Franksen writes: [EMAIL PROTECTED] wrote: ... Does *MATH* answer the question what is: (0/0)==(0/0) ? Nope! Exactly. So why try to give an answer in Haskell? MATH says: the expression 0/0 is undefined, thus comparing (0/0)==(0/0) is undefined, too. I would expect Haskell to say the

Re: [Haskell-cafe] Haskell and GUI

2008-01-14 Thread Thomas Davie
There's also the HOC (Haskell Objective-C bridge), which lets you use Apple's Cocoa APIs. Bob On 14 Jan 2008, at 22:09, Torsten Otto wrote: Seeing my woes with FranTk - what else is out there that people use if a (simple) GUI is desired for a Haskell app? Just a few textboxes and a

[Haskell-cafe] Re: Why purely in haskell?

2008-01-14 Thread jerzy . karczmarczuk
Achim Schneider writes: [EMAIL PROTECTED] wrote: When math says that something is undefined, in my little brain I understand that there is no answer. Math doesn't say that something is undefined, but tells you that you did something that's illegal, i.e. impossible, in the system you're

Re: [Haskell-cafe] Re: Why purely in haskell?

2008-01-14 Thread Luke Palmer
On Jan 15, 2008 12:29 AM, [EMAIL PROTECTED] wrote: Ben Franksen writes: [EMAIL PROTECTED] wrote: ... Does *MATH* answer the question what is: (0/0)==(0/0) ? Nope! Exactly. So why try to give an answer in Haskell? MATH says: the expression 0/0 is undefined, thus comparing (0/0)==(0/0)

[Haskell-cafe] Re: Why purely in haskell?

2008-01-14 Thread Achim Schneider
[EMAIL PROTECTED] wrote: Achim Schneider writes: [EMAIL PROTECTED] wrote: When math says that something is undefined, in my little brain I understand that there is no answer. Math doesn't say that something is undefined, but tells you that you did something that's illegal,

Re: [Haskell-cafe] fast fractional part of floating point number - modf?

2008-01-14 Thread John Meacham
On Sun, Jan 13, 2008 at 01:08:49AM +0100, Henning Thielemann wrote: Is there a fast and reliable way to compute the fraction of a floating point number? no, and this has bothered me to the point I consider it a bug in the language spec that all 'rounding' style functions give back an integral

Re: [Haskell-cafe] Re: 0/0 1 == False

2008-01-14 Thread Jonathan Cast
On 14 Jan 2008, at 9:56 AM, David Roundy wrote: On Fri, Jan 11, 2008 at 07:10:20PM -0800, Jonathan Cast wrote: On 11 Jan 2008, at 10:12 AM, Achim Schneider wrote: David Roundy [EMAIL PROTECTED] wrote: Prelude let x=1e-300/1e300 Prelude x 0.0 Prelude x/x NaN The true answer here is that

Re: [Haskell-cafe] Re: MonadPrompt + Gtk2Hs = ?

2008-01-14 Thread Ryan Ingram
On Jan 14, 2008 2:28 PM, Felipe Lessa [EMAIL PROTECTED] wrote: lastAttempt' :: AttemptCode lastAttempt' showInfo entry button = guessGameNew = contPromptM done cont where cont :: forall a. GuessP a - (a - IO ()) - IO () -- signature needed cont (Print s) c = showInfo s c

[Haskell-cafe] Re: [Haskell] ANNOUNCE: HStringTemplate -- An Elegant, Functional, Nifty Templating Engine for Haskell

2008-01-14 Thread Sterling Clover
I'm absolutely planning to get it up there, but it needs a bit more work first. Just today, gwern sent a bunch of very nice patches that cleaned up some -Wall messages, and fixed a build issue with 6.8. And then, thanks to an email from Martin Lütke, I realized that I had foolishly not

Re: [Haskell-cafe] Re: Re: Displaying # of reductions after eachcomputation in ghci?

2008-01-14 Thread Lennart Augustsson
In lambda calculus you can take a beta reduction as the step. But Haskell is not normally implemented by lambda calculus so you have to pick something else. There are measures of reduction that you can come up with but they will vary, e.g., by compiler, optimization level, etc. I think time is a

[Haskell-cafe] ErrorT and catchError question

2008-01-14 Thread Adam Smyczek
Hi, I'm trying to use ErrorT transformer based on Don Stewart's Shell example: http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10#programmable-semicolons It's probably a trivial question, but I cannot figure out how to implement the catchError function in: instance MonadError String Shell where

Re: [Haskell-cafe] QuickCheck properties: export or not?

2008-01-14 Thread David Benbennick
I think that type classes with nontrivial requirements should export QuickCheck properties that test those requirements. For example, the Data.Monoid module (http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Monoid.html) could export properties that check the monoid laws (for an

Re: [Haskell-cafe] ErrorT and catchError question

2008-01-14 Thread Brandon S. Allbery KF8NH
On Jan 15, 2008, at 0:28 , Adam Smyczek wrote: It's probably a trivial question, but I cannot figure out how to implement the catchError function in: instance MonadError String Shell where throwError = error . (Shell failed: ++) catchError l h = ??? Take a look at

Re: [Haskell-cafe] fast fractional part of floating point number - modf?

2008-01-14 Thread Henning Thielemann
On Mon, 14 Jan 2008, John Meacham wrote: On Sun, Jan 13, 2008 at 01:08:49AM +0100, Henning Thielemann wrote: Is there a fast and reliable way to compute the fraction of a floating point number? no, and this has bothered me to the point I consider it a bug in the language spec that all