[Haskell] Newbie

2013-03-07 Thread Dan Lior
Hello, I'm new to Haskell and this is my first post to this forum. A few questions right off the bat: 1) Is this the right place for newbies to post questions about Haskell? 2) Is there a FAQ for Haskell questions? 3) Are there any active Haskell user groups in the Chicago area? A more

Re: [Haskell] Newbie

2013-03-07 Thread Brandon Allbery
On Thu, Mar 7, 2013 at 7:45 PM, Dan Lior sitipo...@gmail.com wrote: 1) Is this the right place for newbies to post questions about Haskell? This is most a list for announcements; beginn...@haskell.org is better for these kinds of questions, and haskell-c...@haskell.org for general discussion.

Re: [Haskell] Newbie

2013-03-07 Thread Ivan Lazar Miljenovic
On 8 March 2013 11:56, Brandon Allbery allber...@gmail.com wrote: On Thu, Mar 7, 2013 at 7:45 PM, Dan Lior sitipo...@gmail.com wrote: 1) Is this the right place for newbies to post questions about Haskell? This is most a list for announcements; beginn...@haskell.org is better for these

Re: [Haskell-cafe] Haskell-Newbie and Char-Function

2009-12-06 Thread Chaddaï Fouché
On Sat, Dec 5, 2009 at 10:02 PM, ??? ?? m...@rkit.pp.ru wrote: fct a n = (snd $ break (==a) ['a'..'z']) !! n Not bad but you forgot that it might need to wrap around, besides break isn't really the best function to use here since we don't need the first part of the pair : shift n ch =

Re: [Haskell-cafe] Haskell-Newbie and Char-Function

2009-12-06 Thread Richard O'Keefe
On Dec 6, 2009, at 4:42 AM, MeAdAstra wrote: I only started learning Haskell some days ago. Maybe one of you can give me a hint on how to implement a function that needs a character in the range (a,b,...z) and an integer number k and returns the k-next neighbor of the character? For

[Haskell-cafe] Haskell-Newbie and Char-Function

2009-12-05 Thread MeAdAstra
. Tobias -- View this message in context: http://old.nabble.com/Haskell-Newbie-and-Char-Function-tp26656676p26656676.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Haskell-Newbie and Char-Function

2009-12-05 Thread Jochem Berndsen
MeAdAstra wrote: Hi guys, I only started learning Haskell some days ago. Maybe one of you can give me a hint on how to implement a function that needs a character in the range (a,b,...z) and an integer number k and returns the k-next neighbor of the character? For example, fct a 5 would

Re: [Haskell-cafe] Haskell-Newbie and Char-Function

2009-12-05 Thread Chaddaï Fouché
On Sat, Dec 5, 2009 at 4:48 PM, Jochem Berndsen joc...@functor.nl wrote: MeAdAstra wrote: Hi guys, I only started learning Haskell some days ago. Maybe one of you can give me a hint on how to implement a function that needs a character in the range (a,b,...z) and an integer number k and

Re: [Haskell-cafe] Haskell-Newbie and Char-Function

2009-12-05 Thread ??????? ??????
fct a n = (snd $ break (==a) ['a'..'z']) !! n Hi guys, I only started learning Haskell some days ago. Maybe one of you can give me a hint on how to implement a function that needs a character in the range (a,b,...z) and an integer number k and returns the k-next neighbor of the character? For

RE: [Haskell-cafe] Haskell newbie indentation query.

2008-10-17 Thread Ramaswamy, Vivek
Thanks Jules and Daniel. That was very helpful. Regards -Vivek Ramaswamy- -Original Message- From: Jules Bean [mailto:[EMAIL PROTECTED] Sent: 15 October 2008 18:19 To: Ramaswamy, Vivek Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Haskell newbie indentation query

Re: [Haskell-cafe] Re: Haskell newbie indentation query.

2008-10-16 Thread Svein Ove Aas
On Wed, Oct 15, 2008 at 5:25 PM, Jules Bean [EMAIL PROTECTED] wrote: There is a new indentation module which does much better at the indentation stuff: http://kuribas.hcoop.net/haskell-indentation.el I didn't realize until I tried to use yours that there are two indentation modules in

Re: [Haskell-cafe] Re: Haskell newbie indentation query.

2008-10-16 Thread Jules Bean
Svein Ove Aas wrote: On Wed, Oct 15, 2008 at 5:25 PM, Jules Bean [EMAIL PROTECTED] wrote: There is a new indentation module which does much better at the indentation stuff: http://kuribas.hcoop.net/haskell-indentation.el I didn't realize until I tried to use yours that there are two

[Haskell-cafe] Re: Haskell newbie indentation query.

2008-10-16 Thread Simon Michael
Basically it has a more accurate haskell parser, and it has a simpler way of cycling through possible indentations: TAB moves to the right and BACKSPACE to the left. Unfortunately, it can sometimes fail to parse what's in the buffer, get balky and event prevent you typing anything at all. I

Re: [Haskell-cafe] Re: Haskell newbie indentation query.

2008-10-16 Thread Reid Barton
On Thu, Oct 16, 2008 at 12:57:05PM -0700, Simon Michael wrote: Basically it has a more accurate haskell parser, and it has a simpler way of cycling through possible indentations: TAB moves to the right and BACKSPACE to the left. Unfortunately, it can sometimes fail to parse what's in the

Re: [Haskell-cafe] Haskell newbie indentation query.

2008-10-15 Thread Bulat Ziganshin
Hello Vivek, Wednesday, October 15, 2008, 3:39:54 PM, you wrote: i think that practical answer is suggestion to use `case` instead: case () of _ | x 5 - do abc def ... | x==5 - do ... | otherwise - do ... it's pretty common

[Haskell-cafe] Re: Haskell newbie indentation query.

2008-10-15 Thread Simon Michael
Does that help? It helps me a lot. I never clearly understood that there are these two different layout modes in my code (coddled by haskell-mode!) This will cut down some more guesswork. Thanks! ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Haskell newbie indentation query.

2008-10-15 Thread Jules Bean
Simon Michael wrote: Does that help? It helps me a lot. I never clearly understood that there are these two different layout modes in my code (coddled by haskell-mode!) This will cut down some more guesswork. Thanks! There is a new indentation module which does much better at the

Re: [Haskell-cafe] Haskell newbie indentation query.

2008-10-15 Thread Daniel Fischer
Am Mittwoch, 15. Oktober 2008 13:39 schrieb Ramaswamy, Vivek: Hello All~ I have just started with Haskell, and I must confess; I am in love with it. However one area that I am really confused about is indentation. Lets take a look at if-else if- else block. The way I understand it:

Re: [Haskell-cafe] Haskell newbie indentation query.

2008-10-15 Thread Jules Bean
Ramaswamy, Vivek wrote: Hello All~ I have just started with Haskell, and I must confess; I am in love with it. However one area that I am really confused about is indentation. Lets take a look at if-else if- else block. Important point 1. There are two contexts in haskell programs. Layout

[Haskell-cafe] Haskell newbie indentation query.

2008-10-15 Thread Ramaswamy, Vivek
Hello All~ I have just started with Haskell, and I must confess; I am in love with it. However one area that I am really confused about is indentation. Lets take a look at if-else if- else block. The way I understand it: {--} if something then do something 1 something2 else if nothing

[Haskell-cafe] Re: Haskell newbie indentation query.

2008-10-15 Thread Simon Michael
I'm trying that one now. Thanks for the tip! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Template Haskell newbie questions

2007-09-25 Thread Hugo Pacheco
The sel function was just the simpliest example I remembered of. Yes, I would need to generate code at runtime according since the generated code would depend on the function arguments, but have already guessed It wouldn't be possible. Anyway, thanks for the clarification, hugo

Re[2]: [Haskell-cafe] Template Haskell newbie questions

2007-09-25 Thread Bulat Ziganshin
Hello Hugo, Tuesday, September 25, 2007, 1:05:28 PM, you wrote: Yes, I would need to generate code at runtime according since the you have selected improper instrument for it. look at GHC-as-a-lbrary and hs-plugins by Donald Stewart -- Best regards, Bulat

Re: Re[2]: [Haskell-cafe] Template Haskell newbie questions

2007-09-25 Thread Hugo Pacheco
hs-plugins does look promising. thanks for the hint, hugo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Template Haskell newbie questions

2007-09-24 Thread Max Vasin
2007/9/22, Hugo Pacheco [EMAIL PROTECTED]: Hi all, If I want to write some function that will dynamically create a selection function according to its arguments and do something with it. You cannot dynamically create function, all you can is to create it at compile-time (that's what TH lets

[Haskell-cafe] Template Haskell newbie questions

2007-09-22 Thread Hugo Pacheco
Hi all, I'm try to write some function in TH that I don't even know if it is possible. Consider the example from the tutorials sel 1 2 = [| \(x,_) - x |] sel 2 2 = [| \(_,x) - x |] If I want to write some function that will dynamically create a selection function according to its arguments

Re: [Haskell] Newbie help with type-classes

2007-05-11 Thread Bas van Dijk
Add: -fallow-overlapping-instances to your OPTIONS pragma and read about overlapping instances in the GHC User Guide: http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#instance-overlap regards, Bas van Dijk On 5/11/07, Ryan Ingram [EMAIL PROTECTED] wrote: Here's a

Re: [Haskell] Newbie help with type-classes

2007-05-11 Thread Bas van Dijk
Maybe this is not what you want, but you can also put the 'convl' function in the 'ConvertToInt' class. class ConvertToInt a where conv :: a - Int convl :: [a] - [Int] With this approach you don't need any language extension. regards, Bas van Dijk On 5/11/07, Ryan Ingram [EMAIL

Re: [Haskell] Newbie help with type-classes

2007-05-11 Thread Derek Elkins
Ryan Ingram wrote: [EMAIL PROTECTED] is better for this type of question. Follow-up is set to it. Here's a test case for the problem I'm having; I'm using runhaskell from ghc v6.6. Problem #1) Without -fallow-undecidable-instances, I get the following error: Constraint is no smaller

[Haskell] Newbie help with type-classes

2007-05-10 Thread Ryan Ingram
Here's a test case for the problem I'm having; I'm using runhaskell from ghc v6.6. Problem #1) Without -fallow-undecidable-instances, I get the following error: Constraint is no smaller than the instance head in the constraint: ConvertToInt a (Use -fallow-undecidable-instances to

[Haskell] Newbie: fix

2007-05-02 Thread phiroc
Hello, could someone please explain why fix is necessary here: fix (\f l - if null l then [] else let (s,e) = break (==' ') l in s:f (drop 1 e)) Source: http://www.haskell.org/haskellwiki/Blow_your_mind Thanks. phiroc ---BeginMessage--- Hello, could someone please explain why fix in

Re: [Haskell] Newbie: fix

2007-05-02 Thread David House
On 02/05/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, could someone please explain why fix is necessary here: fix (\f l - if null l then [] else let (s,e) = break (==' ') l in s:f (drop 1 e)) Source: http://www.haskell.org/haskellwiki/Blow_your_mind Because you're writing a

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-28 Thread Robert Daniel Emerson
Dear Phiroc, I am also a newbie to Haskell, but I also must confess having a sort of religious conversion. I also admit that the learning curve for Haskell, and in particular associated theory is steep, and I am only on the fist rung of the ladder. Some of what I say here has been echoed by

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-28 Thread Udo Stenzel
[EMAIL PROTECTED] wrote: what are the advantages of haskell over semi-functional programming languages such as Perl, Common Lisp, etc.? A fundamental building block that is superior in maintainability and reusability to objects and procedures, a type system that is actually of help and not a

RE: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-27 Thread Taillefer, Troy (EXP)
Taillefer Java chimpanzee From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sebastian Sylvan Sent: Thursday, April 26, 2007 1:27 PM To: [EMAIL PROTECTED] Cc: haskell@haskell.org Subject: Re: [Haskell] Newbie: what are the advantages of Haskell? (note

[Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread phiroc
Hello, what are the advantages of haskell over semi-functional programming languages such as Perl, Common Lisp, etc.? What are the mysterious side effects which are avoided by using Haskell, which everyone talks about? Null pointers? Don't you ever get null pointers in Haskell, including when

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread Johannes Waldmann
[EMAIL PROTECTED] wrote: [...] semi-functional programming languages such as Perl [...] now this is an interesting view ... ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread phiroc
If this is interesting then please enlighten a poor, ignorant PERL hacker. Quoting Johannes Waldmann [EMAIL PROTECTED]: [EMAIL PROTECTED] wrote: [...] semi-functional programming languages such as Perl [...] now this is an interesting view ...

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread Joe Thornber
On 26/04/07, Johannes Waldmann [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: [...] semi-functional programming languages such as Perl [...] now this is an interesting view ... I seem to remember someone writing a book on functional programming in Perl, which seemed odd to me. - Joe

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread Sebastian Sylvan
(note to Haskellers: Yeah, I'm handwaving things here, no need to point out counter-examples to my generalisations!) On 4/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: We'll do this one first: What are the mysterious side effects which are avoided by using Haskell, which everyone talks

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread Rob Hoelz
[EMAIL PROTECTED] wrote: Hello, what are the advantages of haskell over semi-functional programming languages such as Perl, Common Lisp, etc.? What are the mysterious side effects which are avoided by using Haskell, which everyone talks about? Null pointers? Don't you ever get null

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread mike clemow
Phiroc, I'm new to these ideas too--especially since my college math training is non-existent. I found the following wikipedia articles particularly illuminating on the topic of side-effects: http://en.wikipedia.org/wiki/Side_effect_%28computer_science%29 and

RE: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread Taillefer, Troy (EXP)
these components will actually get written. Troy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, April 26, 2007 12:48 PM To: haskell@haskell.org Subject: [Haskell] Newbie: what are the advantages of Haskell? Hello, what

Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread Keith Fahlgren
On 4/26/07 10:13 AM, Joe Thornber wrote: On 26/04/07, Johannes Waldmann [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: [...] semi-functional programming languages such as Perl [...] now this is an interesting view ... I seem to remember someone writing a book on functional programming

[Haskell-cafe] Re: [Haskell] Newbie: what are the advantages of Haskell?

2007-04-26 Thread Joel Reymont
The biggest advantage of Haskell to me is that it helps me write better programs in other languages. For one reason or another Haskell never turns out to be my final implementation language my my programs gain in the process. Joel -- http://wagerlabs.com/

[Haskell-cafe] Re: literate Haskell newbie question

2007-03-10 Thread Stefan Monnier
cat foo.lhs | grep -e ^ | sed s/^ // Running for the Useless Use of cat Award? A simpler version would be: sed -n -e 's/^//p foo.lhs I don't guarantee that this will work correctly, tho. Maybe sed -n -e 's/^ //p foo.lhs will work better? This said, the OP talked about TeX, so

[Haskell-cafe] literate Haskell newbie question

2007-03-09 Thread Immanuel Normann
I am a newbie to literate Haskell and these are my two simple questions: How do I compile a literate haskell file foo.lhs (using ghc-6.6)? Is there a tool that translates foo.lhs to foo.hs? Surprisingly I don't find the answer in http://haskell.org/haskellwiki/Literate_programming whereas a

Re: [Haskell-cafe] literate Haskell newbie question

2007-03-09 Thread Jefferson Heard
ghc handles lhs files based on their extension. You don't need to translate it to a different format. If you want to translate notation lhs to hs on your own (I dunno why, just if you did), the sed/grep combo cat foo.lhs | grep -e ^ | sed s/^ // would work just fine. On Friday 09 March

[Haskell-cafe] Re: literate Haskell newbie question

2007-03-09 Thread Christian Maeder
Immanuel Normann schrieb: I am a newbie to literate Haskell and these are my two simple questions: How do I compile a literate haskell file foo.lhs (using ghc-6.6)? The same way, how you would translate foo.hs Is there a tool that translates foo.lhs to foo.hs? there is an unlit program

[Haskell] [newbie]any nice code to read?

2006-12-11 Thread 云杨
hello,all, I am new to haskell,and have read some tutorial, but I would like to read some real code from real haskell project, I believe this will help me study and use haskell quickly. would anyone please give me some suggestion about opensource project that a new haskell user should study?

Re: [Haskell] [newbie]any nice code to read?

2006-12-11 Thread 云杨
oh, sorry, I sent to a wrong mailing list. I will ask for help there, thank you, and sorry for disturb you all. On 12/12/06, Donald Bruce Stewart [EMAIL PROTECTED] wrote: notyycn: hello,all, I am new to haskell,and have read some tutorial, but I would like to read some real

Re: [Haskell-cafe] Haskell Quiz Solution - Haskell Newbie Requesting Review

2006-11-10 Thread Justin Bailey
On 11/9/06, Brandon Moore [EMAIL PROTECTED] wrote: Looks nice, especially if you're just getting started. The overall structure looks good, I've just made a bunch of little changes to the details. Mostly I found repeated patterns to replace with library functions or extract as helper functions.

Re: [Haskell-cafe] Haskell Quiz Solution - Haskell Newbie Requesting Review

2006-11-10 Thread Dougal Stanton
Quoth Justin Bailey, nevermore, Above are all more examples of partial functions and function composition. I understand the first concept, but function composition escapes me somehow. What are the rules for partial functions getting arguments when they are eventually supplied? For example, in

Re: [Haskell-cafe] Haskell Quiz Solution - Haskell Newbie Requesting Review

2006-11-10 Thread Justin Bailey
On 11/10/06, Dougal Stanton [EMAIL PROTECTED] wrote: As you noted that doesn't seem right --- how does compile capture its input? Well, the (.) operator is slightly different. It captures variables and passes them into the 'innermost' function, a bit like this: That is a great explanation.

[Haskell-cafe] Haskell Quiz Solution - Haskell Newbie Requesting Review

2006-11-09 Thread Justin Bailey
As part of the Ruby Quiz in Haskell solutions appearing on the wiki recently, I just a solution to Ruby Quiz #100 - create a bytecode interpreter for a simple expression language. Like I said, the code below parses simple integer arithmetic expressions and generates byte codes for a hypothetical

Re: [Haskell-cafe] Haskell Quiz Solution - Haskell Newbie Requesting Review

2006-11-09 Thread Brandon Moore
Justin Bailey wrote: As part of the Ruby Quiz in Haskell solutions appearing on the wiki recently, I just a solution to Ruby Quiz #100 - create a bytecode interpreter for a simple expression language. Like I said, the code below parses simple integer arithmetic expressions and generates byte

Re: [Haskell-cafe] Haskell Quiz Solution - Haskell Newbie Requesting Review

2006-11-09 Thread Brandon Moore
Justin Bailey wrote: As part of the Ruby Quiz in Haskell solutions appearing on the wiki recently, I just a solution to Ruby Quiz #100 - create a bytecode interpreter for a simple expression language. Like I said, the code below parses simple integer arithmetic expressions and generates byte

Re: [Haskell] Newbie quick questions

2005-10-05 Thread Sebastian Sylvan
On 10/4/05, Mike Crowe [EMAIL PROTECTED] wrote: Thanks, all, especially Cale for the detail. This may be unfair to ask, but is anybody willing to give an example? There are great examples for writing factorials. However, that's not really useful. I'm looking for a real-world example of

Re: [Haskell] Newbie quick questions

2005-10-05 Thread Sebastian Sylvan
On 10/5/05, Sebastian Sylvan [EMAIL PROTECTED] wrote: On 10/4/05, Mike Crowe [EMAIL PROTECTED] wrote: Thanks, all, especially Cale for the detail. This may be unfair to ask, but is anybody willing to give an example? There are great examples for writing factorials. However, that's not

Re: [Haskell] Newbie quick questions

2005-10-05 Thread Collin Winter
On 10/4/05, Mike Crowe [EMAIL PROTECTED] wrote: This may be unfair to ask, but is anybody willing to give an example? There are great examples for writing factorials. However, that's not really useful. I'm looking for a real-world example of using the language. You might be interested in

Re: [Haskell] Newbie quick questions

2005-10-04 Thread Jon Fairbairn
On 2005-10-04 at 00:01EDT Mike Crowe wrote: Hi folks, I ran across Haskell at the Great Win32 Computer Language Shootout. A friend approached me with a potential large application to develop. The idea of a language which can reduce time to design and make better code is very

Re: [Haskell] Newbie quick questions

2005-10-04 Thread Duncan Coutts
On Tue, 2005-10-04 at 11:31 +0100, Jon Fairbairn wrote: On 2005-10-04 at 00:01EDT Mike Crowe wrote: Hi folks, I ran across Haskell at the Great Win32 Computer Language Shootout. A friend approached me with a potential large application to develop. The idea of a language which can

Re: [Haskell] Newbie quick questions

2005-10-04 Thread Cale Gibbard
I wouldn't really consider any of those a particularly quick question, but I'll give them a shot :) On 04/10/05, Mike Crowe [EMAIL PROTECTED] wrote: Hi folks, I ran across Haskell at the Great Win32 Computer Language Shootout. A friend approached me with a potential large application to

Re: [Haskell] Newbie quick questions

2005-10-04 Thread Mike Crowe
Thanks, all, especially Cale for the detail. This may be unfair to ask, but is anybody willing to give an example? There are great examples for writing factorials. However, that's not really useful. I'm looking for a real-world example of using the language. Specifically, the first page of

[Haskell] Newbie quick questions

2005-10-03 Thread Mike Crowe
Hi folks, I ran across Haskell at the Great Win32 Computer Language Shootout. A friend approached me with a potential large application to develop. The idea of a language which can reduce time to design and make better code is very intriguing. I was looking at prototyping in Python using

[Haskell-cafe] Question about classes from a Haskell newbie.

2005-05-23 Thread Jeff . Harper
Hi, I'm new to Haskell and even newer to this list. I have over 20 years of experience in C or C++. For fun, I decided to write a Fourier transform in Haskell. It would be convenient if I had a function that converts any real or complex number into a complex number. My attempt at doing this is

Re: [Haskell] [Newbie] Data structure for Dijkstra's algorithm

2005-02-15 Thread Pedro Vasconcelos
On Mon, 14 Feb 2005 15:00:17 +0100 RCP-Software [EMAIL PROTECTED] wrote: For input and output I need an appropriate graph representation. It should be as simple to implement as possible - speed and memory consumption does not matter. The graph consists of vertices (including the source

Re: [Haskell] [Newbie] Data structure for Dijkstra's algorithm

2005-02-15 Thread Josef Svenningsson
On Mon, 14 Feb 2005 12:27:51 -0500, robert dockins [EMAIL PROTECTED] wrote: [Dijkstra's] algorithm relies pretty fundamentally on mutability, which makes it a less than wonderful fit for a functional language. If you want to use this algorithm in particular, I would recommend a mutable

[Haskell] [Newbie] Data structure for Dijkstra's algorithm

2005-02-14 Thread RCP-Software
Hi! I am new to functional Programming and need some advice. I want to implement Dijkstra's algorithm for the shortest path problem. The algorithm calculates the shortest path from a single vertex in a directed graph to any other connected vertex (

Re: [Haskell] [Newbie] Data structure for Dijkstra's algorithm

2005-02-14 Thread robert dockins
This algorithm relies pretty fundamentally on mutability, which makes it a less than wonderful fit for a functional language. If you want to use this algorithm in particular, I would recommend a mutable array indexed on the vertex pair (u,v). See:

Re: [Haskell] [Newbie] Data structure for Dijkstra's algorithm

2005-02-14 Thread ajb
G'day all. Quoting robert dockins [EMAIL PROTECTED]: This algorithm relies pretty fundamentally on mutability, which makes it a less than wonderful fit for a functional language. Right, which makes me wonder if this is the algorithm that you really want. Does it have to be Dijkstra's

[Haskell-cafe] Re: [Haskell] Newbie : How come that cyclic recursive lists areefficient ?

2005-01-25 Thread David Barton
Benjamin Fransen writes: There *is no* difference between the two if one views them as pure mathematical values. Questions of run time speed or memory usage, i.e. efficiency (which your original question was about) are clearly outside the realm of pure values, and thus we may perceive them as

Re: [Haskell-cafe] Re: [Haskell] Newbie : How come that cyclic recursive lists areefficient ?

2005-01-25 Thread Benjamin Franksen
On Tuesday 25 January 2005 14:11, David Barton wrote: Benjamin Fransen writes: There *is no* difference between the two if one views them as pure mathematical values. Questions of run time speed or memory usage, i.e. efficiency (which your original question was about) are clearly outside

[Haskell] Newbie : How come that cyclic recursive lists are efficient ?

2005-01-24 Thread Francis Girard
Hi, The classical Hamming problem have the following solution in Haskell : *** BEGIN SNAP -- hamming.hs -- Merges two infinite lists merge :: (Ord a) = [a] - [a] - [a] merge (x:xs)(y:ys) | x == y= x : merge xs ys | x y= x : merge xs (y:ys) | otherwise = y : merge (x:xs) ys --

Re: [Haskell] Newbie : How come that cyclic recursive lists are efficient ?

2005-01-24 Thread Bruno Abdon
'hamming', in your code, is a top-level definition. When used three times inside its own definition, it's the same variable being used three times. You don't recompute a variable value in order to reuse it. As an example, if you do foo :: [Integer] foo = [1,2,3] + [4,5] bar = foo ++ foo ++ foo

Re: [Haskell] Newbie : How come that cyclic recursive lists are efficient ?

2005-01-24 Thread Lennart Augustsson
It doesn't have to be a top level definition, it works anyway. -- Lennart Bruno Abdon wrote: 'hamming', in your code, is a top-level definition. When used three times inside its own definition, it's the same variable being used three times. You don't recompute a variable value in order to

Re: [Haskell] Newbie : How come that cyclic recursive lists are efficient ?

2005-01-24 Thread Graham Klyne
Notice that 'hamming' *is* a list of integers, not a function to produce them: hamming :: [Integer] Thus, the magic here is that you can define this list as a value, without having to actually evaluate any element until it's needed, either by direct reference from another function, or

Re: [Haskell] Newbie : How come that cyclic recursive lists are efficient ?

2005-01-24 Thread Francis Girard
Thank you, I understand the point. But I can't help thinking that the distinction between being a list of integers and being a function that returns a list of integers (without arguments) is not always clear in FP ... since there is not really such a thing as returning a value in declarative

Re: [Haskell] Newbie : How come that cyclic recursive lists are efficient ?

2005-01-24 Thread Benjamin Franksen
On Monday 24 January 2005 21:47, Francis Girard wrote: But I can't help thinking that the distinction between being a list of integers and being a function that returns a list of integers (without arguments) is not always clear in FP ... since there is not really such a thing as returning a

Re: [Haskell] Newbie Question about Types

2004-09-06 Thread Graham Klyne
I maybe don't fully grasp your goals here, but this sounds similar to some early problems I ran into with Haskell (coming from comparable background), and here are a couple of comments that _might_ just help: (a) adding a type context to a 'data' declaration seems to be very rarely, if ever,

[Haskell] Newbie Question about Types

2004-08-27 Thread David Greenberg
Hi, I very recently just came to Haskell from the Java and Perl worlds, so my understanding of Haskell's type system is still a little vague. The tutorial and Google didn't seem to have an answer to my question, so I am hoping someone here might be able to help me. I am writing some code

[Haskell] newbie question: variable not in scope: isSpace

2004-08-14 Thread A.J. Bonnema
If I use isSpace from the hugs interpretor, it works. If I use isSpace from a test.hs file I get the error message: Undefined variable isSpace From ghc I get the error message: Variable not in scope: isSpace What is wrong? Guus. -- A.J. Bonnema, Leiden The Netherlands, user #328198 (Linux Counter

Re: [Haskell] newbie question: variable not in scope: isSpace

2004-08-14 Thread Tom Pledger
A.J. Bonnema wrote: If I use isSpace from the hugs interpretor, it works. If I use isSpace from a test.hs file I get the error message: Undefined variable isSpace From ghc I get the error message: Variable not in scope: isSpace What is wrong? Hugs automatically imports a few extra things as well

[Haskell] newbie question

2004-02-09 Thread Lee Render
is HaskellScript still working? I tried mucking around with this lately using the latest version of Hugs but the example scripts seemed broken. __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html

Re: [Haskell-cafe] Haskell newbie

2004-02-08 Thread Philippa Cowderoy
On Sun, 8 Feb 2004, Justin Walsh wrote: Can anyone recommend a very thin Linux/Haskell setup for DHCP cable? Jus. Do a Debian net install, upgrade to testing and apt-get a recent GHC and your preferred text editor? -- [EMAIL PROTECTED] ___

Re: haskell newbie seeking for advice

2003-08-14 Thread Glynn Clements
Jose A.Ortega Ruiz wrote: as stated in the subject, i'm a newcomer to haskell programming: i've read some tutorials and (portions of) a couple of books and am really fascinated with the language. but my haskell coding experience is limited to toy programs and short exercises. so i decided to

haskell newbie seeking for advice

2003-08-14 Thread Jose A . Ortega Ruiz
hi all, as stated in the subject, i'm a newcomer to haskell programming: i've read some tutorials and (portions of) a couple of books and am really fascinated with the language. but my haskell coding experience is limited to toy programs and short exercises. so i decided to try my hand at a

Re: haskell newbie seeking for advice

2003-08-14 Thread Iavor Diatchki
hi, Jose A.Ortega Ruiz wrote: hi all, as stated in the subject, i'm a newcomer to haskell programming: i've read some tutorials and (portions of) a couple of books and am really fascinated with the language. but my haskell coding experience is limited to toy programs and short exercises. so i