Re: [Haskell-cafe] implementing a csv reader

2006-08-23 Thread Andy Elvey
On Tue, 2006-08-22 at 11:59 +0200, Tamas K Papp wrote: On Tue, Aug 22, 2006 at 11:26:45AM +0200, Henning Thielemann wrote: See also http://www.xoltar.org/languages/haskell.html http://www.xoltar.org/languages/haskell/CSV.hs Thanks. Haskell is incredibly neat ;-) Now I

Re: [Haskell-cafe] Re: type synonym liberalization (was class [] proposal)

2006-08-23 Thread Bulat Ziganshin
Hello Arie, Wednesday, August 23, 2006, 2:54:54 AM, you wrote: With the proper interpretation, type synonyms like type ABlockStream = BlockStream b = b type AMemoryStream = MemoryStream m = m How does your proposal compare to introducing existential types proper? As in type ABlockStream

RE: [Haskell-cafe] Re: Memoizing longest-common-subsequence

2006-08-23 Thread Bayley, Alistair
From: Jared Updike [mailto:[EMAIL PROTECTED] Thanks for posting the code. It works on pretty large data sets (for example, a thousand Strings each) and I have a hunch that if I use Data.ByteString it would even work fast enough on my quarter meg text files (split on words, ~40,000 and

Re: Re[2]: class [] proposal Re: [Haskell-cafe] One thought: Num to 0as ? to list?

2006-08-23 Thread Malcolm Wallace
it's because you not programmed a lot with type classes. if you start, you will soon realize that type signatures with classes are just unreadable. just look at sources of my streams library copyStream :: (BlockStream h1, BlockStream h2, Integral size) = h1 - h2 -

Re[2]: [Haskell-cafe] Re: Memoizing longest-common-subsequence

2006-08-23 Thread Bulat Ziganshin
Hello Alistair, Wednesday, August 23, 2006, 1:43:30 PM, you wrote: I've found the folder in which I did some of this testing, and GNU diff has no problem with the input files; they're only 7M, My program spends 70% of its time doing String-IO (so 30% in the algorithm), and peaks at about

Re: Re[2]: class [] proposal Re: [Haskell-cafe] One thought: Num to 0as ? to list?

2006-08-23 Thread Tomasz Zielonka
On Wed, Aug 23, 2006 at 01:28:57PM +0100, Malcolm Wallace wrote: The lengths people will go to in making things difficult for the reader, just to save a few characters is truly amazing. Remember, the code will be read many more times than it is written. IMHO, the various proposed sugar adds

Re: Re[2]: class [] proposal Re: [Haskell-cafe] One thought: Num to 0as ? to list?

2006-08-23 Thread Donald Bruce Stewart
tomasz.zielonka: On Wed, Aug 23, 2006 at 01:28:57PM +0100, Malcolm Wallace wrote: The lengths people will go to in making things difficult for the reader, just to save a few characters is truly amazing. Remember, the code will be read many more times than it is written. IMHO, the various

[Haskell-cafe] Proposal to allow {} instead of () in contexts

2006-08-23 Thread Brian Hulley
Hi - Disregarding my last proposal which involved the use of {} in types, I am wondering if anyone would agree with me that it would be a good idea to use {} instead of () when writing out the context ie: foo :: (Num a, Bar a) = a - a would become: foo :: {Num a, Bar a} = a - a and

[Haskell-cafe] extreme newbie: hugs prompt vs load module

2006-08-23 Thread George Young
[linux, ghci 6.4.3.20060820, hugs May 2006] I have just started learning Haskell. I have hugs and ghci under linux, and I'm going through the Gentle Introduction to Haskellhttp://www.haskell.org/tutorial, so far through section 4, case expressions and pattern matching. I'm a python programmer,

Re: [Haskell-cafe] extreme newbie: hugs prompt vs load module

2006-08-23 Thread Robert Dockins
On Aug 23, 2006, at 10:16 AM, George Young wrote: [linux, ghci 6.4.3.20060820, hugs May 2006] I have just started learning Haskell. I have hugs and ghci under linux, and I'm going through the Gentle Introduction to Haskellhttp://www.haskell.org/tutorial, so far through section 4, case

Re: Re[2]: class [] proposal Re: [Haskell-cafe] One thought: Num to 0as ? to list?

2006-08-23 Thread Tomasz Zielonka
On Wed, Aug 23, 2006 at 11:11:59PM +1000, Donald Bruce Stewart wrote: So, from vim the following source: f (x,y,z) a b = y + a + b hit, 'ty' and its replaced with: f :: forall b c a. (Num b) = (a, b, c) - b - b - b f (x,y,z) a b = y + a + b Nice! Best regards Tomasz

Re: [Haskell-cafe] Proposal to allow {} instead of () in contexts

2006-08-23 Thread Brian Smith
On 8/23/06, Brian Hulley [EMAIL PROTECTED] wrote: Hi -Disregarding my last proposal which involved the use of {} in types, I amwondering if anyone would agree with me that it would be a good idea to use{} instead of () when writing out the context ie: foo :: (Num a, Bar a) = a - awould become:foo

Re: [Haskell-cafe] extreme newbie: hugs prompt vs load module

2006-08-23 Thread Brandon Moore
George Young wrote: [linux, ghci 6.4.3.20060820, hugs May 2006] I have just started learning Haskell. I have hugs and ghci under linux, and I'm going through the Gentle Introduction to Haskellhttp://www.haskell.org/tutorial, so far through section 4, case expressions and pattern matching. I'm

Re: [Haskell-cafe] extreme newbie: hugs prompt vs load module

2006-08-23 Thread Bulat Ziganshin
Hello George, Wednesday, August 23, 2006, 6:16:12 PM, you wrote: I'm confused about what sort of things I can type at the interpreter prompt, and what things have to be loaded as a module. I keep trying to treat the prompt like a lisp or python REPL, which is obviously wrong. Can someone

Re: [Haskell-cafe] extreme newbie: hugs prompt vs load module

2006-08-23 Thread Shao Chih Kuo
You can always load things inside ghci with: :m i.e. Prelude :m List Prelude List :m Control.Concurrent Prelude Control.Concurrent :m Control.Concurrent List Prelude List Control.Concurrent George Young wrote: [linux, ghci 6.4.3.20060820, hugs May 2006] I have just started learning Haskell.

Re: [Haskell-cafe] implementing a csv reader

2006-08-23 Thread Henk-Jan van Tuyl
L.S., Reading and writing a comma seperated datafile doesn't have to be that complicated; the following is an easy way to read a CSV file into a list of tuples and display the list on screen: displayTuples = do csvData - readFile data.csv putStrLn $ unlines $ map (show .

Re: [Haskell-cafe] implementing a csv reader

2006-08-23 Thread Robert Dockins
On Aug 23, 2006, at 3:37 PM, Henk-Jan van Tuyl wrote: L.S., Reading and writing a comma seperated datafile doesn't have to be that complicated; the following is an easy way to read a CSV file into a list of tuples and display the list on screen: For every complex problem, there is a

[Haskell-cafe] Cabal question, adding data files

2006-08-23 Thread Neil Mitchell
Hi, I have a cabal executable, which requires additional data files. How do I do this in Cabal? I have seen extra-source-files, but they are not added at install time to the destination directory, which doesn't help me. I noticed that Alex does this, but with a lot of Cabal calling in Setup.hs

Re: [Haskell-cafe] Cabal question, adding data files

2006-08-23 Thread Ross Paterson
On Wed, Aug 23, 2006 at 10:42:54PM +0100, Neil Mitchell wrote: I have a cabal executable, which requires additional data files. How do I do this in Cabal? I have seen extra-source-files, but they are not added at install time to the destination directory, which doesn't help me. The field you

Re: [Haskell-cafe] Cabal question, adding data files

2006-08-23 Thread Neil Mitchell
Hi The field you want is data-files, documented in section 2.1.1 of the Cabal User's Guide. That looks perfect. Is there any reason that Alex doesn't use this? I was trying to learn by example. Thanks Neil ___ Haskell-Cafe mailing list

Re: Re[2]: class [] proposal Re: [Haskell-cafe] One thought: Num to 0as ? to list?

2006-08-23 Thread Toby Hutton
On 8/23/06, Donald Bruce Stewart [EMAIL PROTECTED] wrote: I use the following script from vim to infer top level type declarationsfor me. I've found it particularly useful for understanding others' code:delurkOn the topic of coding Haskell with Vim is there an indentation plugin for Haskell

Re: [Haskell-cafe] Proposal to allow {} instead of () in contexts

2006-08-23 Thread Brian Hulley
On August 23, 2006 5:16 PM, Brian Smith wrote On 8/23/06, Brian Hulley [EMAIL PROTECTED] wrote: Hi - Disregarding my last proposal which involved the use of {} in types, I am wondering if anyone would agree with me that it would be a good idea to use {} instead of () when writing out the

[Haskell-cafe] Fran - Functional Reactive Animation

2006-08-23 Thread HIGGINS Neil (ENERGEX)
Title: Fran - Functional Reactive Animation Fran is a Haskell library (or embedded language) for interactive animations with 2D and 3D graphics and sound. See http://www.conal.net/fran/ and

Re: [Haskell-cafe] Fran - Functional Reactive Animation

2006-08-23 Thread Jared Updike
I think this works: http://haskell.org/edsl/pansharp.html Jared. On 8/23/06, HIGGINS Neil (ENERGEX) [EMAIL PROTECTED] wrote: Fran is a Haskell library (or embedded language) for interactive animations with 2D and 3D graphics and sound. See http://www.conal.net/fran/ and

Re: [Haskell-cafe] Cabal question, adding data files

2006-08-23 Thread Conrad Parker
On Wed, Aug 23, 2006 at 11:36:00PM +0100, Neil Mitchell wrote: Hi The field you want is data-files, documented in section 2.1.1 of the Cabal User's Guide. That looks perfect. Is there any reason that Alex doesn't use this? I was trying to learn by example. Perhaps because Alex predates