Re: [Haskell-cafe] Re: Multiparamater class type-inference error

2007-01-29 Thread Yitzchak Gale
Alfonso Acosta wrote: fstSY = mapSY fst No instance for (Synchronous s ((a, b) - a) (a, b) a)... ...no error arises if I explicitly give the type signature of fstSY fstSY :: Signal (a,b) - Signal a This is the notorious Monomorphism Restriction. See

RE: [Haskell-cafe] proposal: HaBench, a Haskell Benchmark Suite

2007-01-29 Thread Simon Peyton-Jones
| I think that we should have, as David Roundy pointed out, a | restriction to code that is actually used frequently. However, I | think we should make a distinction between micro-benchmarks, that | test some specific item, and real-life benchmarks. As many of you will know, the nofib benchmark

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Yitzchak Gale
After many years of OO Perl, I looked at Python. Within fifteen minutes I had switched, and I never looked back at Perl. A few years later, I had a need to hack into the Python interpreter. While reading up on that, I came across references to Haskell. I soon realized that everything I liked

RE: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Neil Mitchell My standard solution was to invoke wget, but a Haskell solution would be nicer. For my purpose following redirects etc. isn't required, so thanks very much for your help. I will be releasing this function as part

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Doaitse Swierstra
On Jan 29, 2007, at 9:53 AM, Yitzchak Gale wrote: After many years of OO Perl, I looked at Python. Within fifteen minutes I had switched, and I never looked back at Perl. A few years later, I had a need to hack into the Python interpreter. While reading up on that, I came across references to

Re: [Haskell-cafe] Happy outputs parE - ideas on what to change in my .y file?

2007-01-29 Thread Ulf Norell
On Jan 27, 2007, at 11:11 AM, Mark Wassell wrote: Sometimes happy outputs 'parE' when I run it on my .y file? I believe it is coming from a part of Grammer.lhs which has the comment line This bit is a real mess, mainly because of the error message support. Are there any suggestions on

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Yitzchak Gale
Neil Mitchell wrote: I will be releasing this function as part of a library shortly Alistair Bayley wrote: no! The code was merely meant to illustrate how a really basic HTTP GET might work. It certainly doesn't deal with a lot of the additional cases, like redirects and resource moves, and

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Yitzchak Gale
I wrote: I soon realized that everything I liked about Python had been borrowed from Haskell in diluted form. Doaitse Swierstra wrote: I do not think you are entirely right here; a lot of things were borrowed from a language called ABC, See: http://homepages.cwi.nl/~steven/abc/ True. I

RE: [Haskell-cafe] What is the best way to understand large programs?

2007-01-29 Thread José Miguel Vilaça
Hi Some sort of module dependancy graph would also be handy, but I'm not sure any program can yet produce that kind of information. Take a look to HaSlicer (http://labdotnet.di.uminho.pt/HaSlicer/HaSlicer.aspx ) Currently it is only available online but if you want it to run locally in your

[Haskell-cafe] Paths to tree

2007-01-29 Thread John Ky
Hi, I've written some code and was wondering if there was a better way to write it in terms of readability, brevity and/or efficiency. The function concerned is pathsToForest which takes a list of paths (ie. [[String]]) and converts it into a tree structure where the individual nodes are the

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Neil Mitchell
Hi My standard solution was to invoke wget, but a Haskell solution would be nicer. For my purpose following redirects etc. isn't required, so thanks very much for your help. I will be releasing this function as part of a library shortly, so will be giving you credit for your help! Good

[Haskell-cafe] c2hs failed to process __extension__

2007-01-29 Thread 向井 淳
Hello all, I have a trouble when compiling a program with c2hs. The program can be seen at http://www.city5.org/prog/hstraier/, which is a binding with HyperEstraier (a fulltext search system). When I compile it at FreeBSD 6.2, I encountered the following error: | % runghc Setup.hs build |

Re: [Haskell-cafe] c2hs failed to process __extension__

2007-01-29 Thread Duncan Coutts
On Mon, 2007-01-29 at 21:25 +0900, 向井 淳 wrote: c2hs fails to process __extension__? From the changelog, c2hs now can understand __extension. Is this an exceptional case? Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of

Re: [Haskell-cafe] c2hs failed to process __extension__

2007-01-29 Thread 向井 淳
On 2007/01/29, at 21:55, Duncan Coutts wrote: Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of __extension. Yes. I use the latest version of c2hs from darcs. | % c2hs --version | C-Haskell Compiler, version 0.14.6

Re: [Haskell-cafe] State of OOP in Haskell

2007-01-29 Thread Steve Downey
The primary goal of writing source code isn't to communicate to a computer, but to communicate to a human being. That implies that the communication should be at a high enough level of abstraction to be easily understood by people, while not losing the precision necessary for a computer. OO, at

[Haskell-cafe] Re: Paths to tree

2007-01-29 Thread apfelmus
John Ky wrote: I've written some code and was wondering if there was a better way to write it in terms of readability, brevity and/or efficiency. The function concerned is pathsToForest which takes a list of paths (ie. [[String]]) and converts it into a tree structure where the individual

Re: [Haskell-cafe] Channel9 Interview: Software Composability and theFu ture of Languages

2007-01-29 Thread Paul Moore
On 29/01/07, Michael T. Richter [EMAIL PROTECTED] wrote: I started, given that I could actually have the free time now, looking at Haskell again about a year ago. (It's a major point in Haskell's favour that it always stuck around in my mind after first encountering and rejecting it,

Re: [Haskell-cafe] State of OOP in Haskell

2007-01-29 Thread Arie Peterson
Steve Downey wrote: | OO, at least when done well, maps well to how people think. Things | that can be directed to perform actions. There is also a well | developed practice of OO analysis and design. It's not clear (at least | to me) that there is an equivalent set of practices for functional |

Re: [Haskell-cafe] proposal: HaBench, a Haskell Benchmark Suite

2007-01-29 Thread Paul Moore
On 29/01/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: We found these categories to be useful and robust, and I think they'd be useful for the new suite. In particular, the imaginary suite is useless for (say) choosing a compiler, but fantastic for exposing particular weak spots. But if

Re: [Haskell-cafe] State of OOP in Haskell

2007-01-29 Thread Yitzchak Gale
Steve Downey wrote: OO, at least when done well, maps well to how people think. Um, better duck. I am afraid you are about to draw some flames on that one. I hope people will try to be gentle. OO does NOT always map well to how most people think. OO maps well to how people trained in OO

[Haskell-cafe] Error and warning messages with -O

2007-01-29 Thread Marco Túlio Gontijo e Silva
Hello, I was trying to compile a library I wrote with cabal, but I couldn't because of -O. I tried removing it and it worked ok. Then I noticed that -O was giving some warnings and an error that are not present without it: [EMAIL PROTECTED]:~/codigo/haskell/haskellgpc/haskellgpc$ /usr/bin/ghc

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Ross Paterson
On Fri, Jan 26, 2007 at 01:51:01PM +1100, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release of a new,

Re: [Haskell-cafe] Error and warning messages with -O

2007-01-29 Thread Marco Túlio Gontijo e Silva
Em Seg, 2007-01-29 às 13:34 -0200, Marco Túlio Gontijo e Silva escreveu: Hello, I was trying to compile a library I wrote with cabal, but I couldn't because of -O. I tried removing it and it worked ok. Then I noticed that -O was giving some warnings and an error that are not present without

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Jeremy Shaw
Hi, I was working in embedded development, writing lots of C code. My primary tool for debugging things was turning an LED on or off. So, I became quite interested in figuring out how to write code with less bugs. After some searching, I found lclint, (now knows as splint:

[Haskell-cafe] How to write elegant Haskell programms? (long posting)

2007-01-29 Thread Michael Roth
Hello list, I'm new to Haskell and I'm trying to learn how to write elegant code using Haskell. I decided to convert the following small tool, written in ruby: === #! /usr/bin/env ruby require 'pathname' BASENAMES = %w{ mail.log

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Bjorn Bringert
On Jan 29, 2007, at 16:38 , Ross Paterson wrote: On Fri, Jan 26, 2007 at 01:51:01PM +1100, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell - - The Binary Strike

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Bjorn Bringert
On Jan 29, 2007, at 11:11 , Yitzchak Gale wrote: Neil Mitchell wrote: I will be releasing this function as part of a library shortly Alistair Bayley wrote: no! The code was merely meant to illustrate how a really basic HTTP GET might work. It certainly doesn't deal with a lot of the

Re: [Haskell-cafe] How to write elegant Haskell programms? (long posting)

2007-01-29 Thread David Roundy
On Mon, Jan 29, 2007 at 08:14:55PM +0100, Michael Roth wrote: Hello list, Hi! Just to simplify one function... logdir = /var/log ... makeOldname :: String - String makeOldname fn = logdir ++ '/' : fn ... main :: IO () main = do files - liftM (filter isLogfile)

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread brad clawsie
hi, i have popped in on this thread before to mention my own extension to Network.HTTP (http://www.b7j0c.org/content/haskell-http.html, providing get() and head()). i would like to thank bjorn for his work on Network.HTTP and echo his observation that this package needs some work and active

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread David Kirkman
On 1/28/07, Alexy Khrabrov [EMAIL PROTECTED] wrote: How do people stumble on Haskell? I've taught ML at UPenn, and many For some diversity ... For years I'd been using (and largely happy with) pure fortran with a little tcl thrown in for scripting. I'd played around with a few other

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Dan Mead
I find it odd when people talk about portability in languages. Form me that has always been a given (I started my first language, c++ in 2002). I got into Haskell and FP in general when I took advanced languages at my uni and I still write haskell java and c++ regularly. On 1/29/07, David

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Donald Bruce Stewart
clawsie: hi, i have popped in on this thread before to mention my own extension to Network.HTTP (http://www.b7j0c.org/content/haskell-http.html, providing get() and head()). i would like to thank bjorn for his work on Network.HTTP and echo his observation that this package needs some work

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread brad clawsie
right. there's a bit of a loose group of people who want to take on the http library and practical, authoritative version, but its a lot of work. Starting with the great code already in HAppS is one option too. So yes, we need to fix it. There's people to do it. Now we just need social

Re: [Haskell-cafe] c2hs failed to process __extension__

2007-01-29 Thread Duncan Coutts
On Mon, 2007-01-29 at 22:26 +0900, 向井 淳 wrote: On 2007/01/29, at 21:55, Duncan Coutts wrote: Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of __extension. Yes. I use the latest version of c2hs from darcs. Then sorry,

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Neil Mitchell
Hi So yes, we need to fix it. There's people to do it. Now we just need social factors to kick in and make it happen! We really do! The inability to get a file off a website is quite depressing given that the hard bit should be designing an API, but that anyone could do that for openURL in

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Donald Bruce Stewart
ross: On Fri, Jan 26, 2007 at 01:51:01PM +1100, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release of

[Haskell-cafe] GHC-Cygwin

2007-01-29 Thread Daniil Elovkov
Hello Haskellers My desire is simple. I want GHC-Cygiwn. I spent quite a lot of time struggling, trying to build ghc-6.6-Cygwin with ghc-6.4.1-mingw32. After having patched a lot of #ifdefs and the like I finally did it. Threaded RTS doesn't seem to work, but that's ok. And all that only to

Re: [Haskell-cafe] GHC-Cygwin

2007-01-29 Thread Neil Mitchell
Hi Daniil My desire is simple. I want GHC-Cygiwn. Why? I find Cygwin really really horrible and avoid it where possible. I was just wondering what advantages you get from having GHC-Cygwin? Thanks Neil ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] GHC-Cygwin

2007-01-29 Thread Daniil Elovkov
Hello Well, where possible seem to be important words in my view. There are quite a lot of Haskell problems which rely on posix functionality. Still, it is very desirable to work with them on Windows to me. Maybe there is another way to deal with them, that hasn't come to my mind? 2007/1/30,

Re: [Haskell-cafe] c2hs failed to process __extension__

2007-01-29 Thread Duncan Coutts
On Mon, 2007-01-29 at 22:26 +, Duncan Coutts wrote: On Mon, 2007-01-29 at 22:26 +0900, 向井 淳 wrote: On 2007/01/29, at 21:55, Duncan Coutts wrote: Did you try the very latest darcs version of c2hs? Yesterday I added a couple patches that try to cope with more uses of __extension.

Re: [Haskell-cafe] GHC-Cygwin

2007-01-29 Thread Daniil Elovkov
2007/1/30, Daniil Elovkov [EMAIL PROTECTED]: Hello Well, where possible seem to be important words in my view. There are quite a lot of Haskell problems which rely on posix Haskell programs, sorry :) It's quite late here already functionality. Still, it is very desirable to work with them

Re: [Haskell-cafe] How to write elegant Haskell programms? (long posting)

2007-01-29 Thread Eric Mertens
-- Here's my contribution to the Haskell way to do it import Directory (renameFile) import System.FilePath import System.Path.Glob (glob) import System.Time basenames= [ mail.log, thttpd.log ] logdir = /var/log archivedir = /var/log/archive main = forM_ bases $ \base - do olds -

Re: [Haskell-cafe] How to write elegant Haskell programms? (long posting)

2007-01-29 Thread Eric Mertens
-- here was my original before I allowed someone (no names) to mangle mine for me ;) import Control.Monad (liftM, forM_) import Directory (getModificationTime, renameFile) import Text.Printf (printf) import System.FilePath ((/),(.)) import System.Locale (defaultTimeLocale) import

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Tomasz Zielonka
On Tue, Jan 30, 2007 at 09:52:01AM +1100, Donald Bruce Stewart wrote: For the syntax, and So that people can directly port their code from NewBinary. (The instances are basically unchanged). newtype PutM a = Put { unPut :: (a, Builder) } type Put = PutM () It is always (). BTW,

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Donald Bruce Stewart
tomasz.zielonka: On Tue, Jan 30, 2007 at 09:52:01AM +1100, Donald Bruce Stewart wrote: For the syntax, and So that people can directly port their code from NewBinary. (The instances are basically unchanged). newtype PutM a = Put { unPut :: (a, Builder) } type Put = PutM ()

RE: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Bob Davison
From: Alexy Khrabrov [EMAIL PROTECTED] To: haskell-cafe@haskell.org Subject: [Haskell-cafe] How did you stumble on Haskell? Date: Sun, 28 Jan 2007 19:01:57 -0800 How do people stumble on Haskell? -- snip What's folks most interesting ways to arrive at FP? Cheers, Alexy I have been

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Conrad Parker
On 28/01/07, Donald Bruce Stewart [EMAIL PROTECTED] wrote: I've added raw primitives for: {put,get}Wordhost {put,get}Word16host {put,get}Word32host {put,get}Word64host which do unaligned, host-sized, host-endian packing of data. Writing is some 15% faster for Words, a bit

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Neil Mitchell
Hi Conrad, If the data header stores the alignment/size/endianness, then there's no reason for the data to be unportable. The normal get* instances (not get*host) could suffice for reading. That requires the stream to have a header. Which means that any arbitrary slice within the ByteString

[Haskell-cafe] Re: How did you stumble on Haskell?

2007-01-29 Thread Chung-chieh Shan
Bob Davison [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: This leads me off thread to ask if anyone could recommend reading for someone who has done mathematics to college level, but nearly 30 years ago when many English schools didn't cover 20th

Re: [Haskell-cafe] How to write elegant Haskell programms? (long posting)

2007-01-29 Thread David Roundy
On Mon, Jan 29, 2007 at 05:30:41PM -0600, Eric Mertens wrote: import Control.Monad (liftM, forM_) import Directory (getModificationTime, renameFile) import Text.Printf (printf) import System.FilePath ((/),(.)) import System.Locale (defaultTimeLocale) import System.Path.Glob (glob) import

Re: [Haskell-cafe] How to write elegant Haskell programms? (long posting)

2007-01-29 Thread Michael T. Richter
On Mon, 2007-29-01 at 20:14 +0100, Michael Roth wrote: Ok, the tool written in Haskell works. But, to me, the source doesn't look very nice and even it is larger than the ruby solution, and more imporant, the programm flow feels (at least to me) not very clear. I am by no means a Haskell (or

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-01-29 Thread Bryan O'Sullivan
Bob Davison wrote: I thought calculus was about differentiation and integration and was very surprised to discover that there were such things as 'predicate calculus', 'propositional calculus', and various flavours of 'lambda calculus'. The stuff involving rates of change, integration, and

Re: [Haskell-cafe] How to write elegant Haskell programms? (long posting)

2007-01-29 Thread jeff p
Hello, I think that whole program flow thing is something you get used to. In true, pure functional programming (i.e. Haskell) program flow is a meaningless term, basically. Haskell is a declarative language, not an imperative one. You have to learn to give up that control and trust the

Re: [Haskell-cafe] Simple HTTP lib for Windows?

2007-01-29 Thread Daniel McAllansmith
I've fallen off the pace on this thread so this is a composite reply, mainly to Bjorn, Brad and Yitzchak... I would also like to express my gratitude for the work that Bjorn, and all the others involved, have done on the http library. I certainly appreciated having it available for use. I