Talk:Haskell (programming language)
From Wikipedia, the free encyclopedia
[edit] Eager evaluation
1What's meant by an "eager" variation? I worked with functional languages for some amount of time and never heard the term. --Robert Merkel
- I'm pretty sure it means "without lazy evaluation". --Anon.
-
- That's right. --The Anome
-
-
- Basic Lambda Calculus theory... Just read some. Eager means you are always reducing the rightmost redex. The other "simple" option (more complex options are what Explicit Substitution Calculi studies) is to always reduce the leftmost redex. This second option is guaranteed to always reduce to a Normal Form if it exists (the eager doesnt guarantee this). Lazy is a refinement of the second option where you store pointers to redexes that eventually get copied around. -- Anon —Preceding unsigned comment added by 189.11.192.130 (talk) 20:55, 14 November 2007 (UTC)
-
[edit] Boasting
- "Haskell is, as of 2002, the functional language on which the most research is being performed."
Do you have a reference for this statement? --Taw
- "It is one of the more popular functional languages"
Likewise for this unreferenced claim. —The preceding unsigned comment was added by 17.221.40.150 (talk) 00:08, 13 April 2007 (UTC).
Is it okay to remove this blatant lie? Nobody uses haskell, and this reference hardly has any relation to "the most research is being performed" 85.140.204.113 16:01, 22 July 2007 (UTC)
-
- A survey of recent literature shows that Haskell syntax is widely used in functional programming research, but it is doubtful that there exists a reference that actually justifies that it is 'most used'. —Preceding unsigned comment added by 130.126.108.208 (talk) 20:59, 30 October 2007 (UTC)
[edit] Page move
"Haskell" can also refer to http://www.haskell.edu/, so I'm not moving this page to Haskell. --Eloquence 16:55 Jan 24, 2003 (UTC)
[edit] Code example
Not sure about the new version of the Fibonacci sequence example — it's longer than the first one and harder to read IMHO (although it is clever, I admit). Any comments on this? --Cadr
- Which one? --Taku 16:14, Apr 6, 2004 (UTC)
-
- The one using
zipWith
--Cadr
- The one using
-
-
- I see this change:
- fibs = 0 : 1 : (zipWith (+) fibs (tail fibs))
- to
- fibs@(_:rest) = 0 : 1 : (zipWith (+) fibs rest)
- --Taku 16:36, Apr 6, 2004 (UTC)
- I see this change:
-
-
-
-
- Yes, that's the one I meant, thanks. --Cadr
-
-
I got the idea: can we present both versions on the article and discuss how they work. To be honest, I don't know how the second one works and I want to know why you said it's a clever way. The readers might be fascinated by the fact Haskell is so cool. --Taku 16:52, Apr 6, 2004 (UTC)
- Should we do that then? There's a whole bunch of example code in the article but no explanation of what it's doing, or what it results in. For example, the fibs line above results in an infinite (lazy) list of Fibonacci numbers, something that I think would be interesting to point out. Also, we might consider using this version (which I prefer):
fib@(_:tfib) = 1 : 1 : [ (a+b) | (a,b) <- zip fib tfib ]
- It demonstrates list comprehension, simple use of the zip function from the Prelude, and is achingly elegant IMO!
[edit] Type inference
Should this article mention Hindley-Milner type inference and the monomorphism restriction? Or is this too detailed information to be included into a encyclopedic article? --Tobias Bergemann 08:30, 2004 Nov 16 (UTC)
[edit] .NET information deletion
Why the deletion of the 'extensions' section on Hugs98 for .NET? I can't immediately see why it'd be problematic. (And there no rationale provided.) --Alai 19:36, 19 Jan 2005 (UTC)
[edit] Literate mode
On the literate programming page, someone mentioned Haskell as a language that "makes full use of literate programming". As pointed out in the Talk page there, that is not how I remember Haskell, but I'd appreciate if someone could clarify things there. --Ar 17:08, 2005 Feb 7 (UTC)
- I can't check at the moment, but I seem to recall the GHC docs mentioning literate programming. I think it has a facility for that as well as it's C-related stuff. --195.137.47.14 00:36, 23 July 2005 (UTC)
-
- The revised Haskell 98 standard document, "Haskell 98 language and libraries: the Revised Report" (2002) contains a section on literate programming. Quoting from Section 9.4 Literate Comments:
-
-
- "The "literate comment" convention, first developed by Richard Bird and Philip Wadler for Orwell, and inspired in turn by Donald Knuth's "literate programming", is an alternative style for encoding Haskell source code. The literate style encourages comments by making them the default. A line in which ">" is the first character is treated as part of the program; all other lines are comment."
- [...]
- "By convention, the style of comment is indicated by the file extension, with ".hs" indicating a usual Haskell file and ".lhs" indicating a literate Haskell file."
-
-
- I don't know if this section was already part of the original Haskell 98 standard. I am not sure if and how this should be incorporated into the Haskell entry. --Tobias Bergemann 07:55, 23 July 2005 (UTC)
[edit] Lambda calculus syntax
- "The '.' in the above is the '.' from Lambda calculus, a core part of functional programming."
Not at all, as far as I know, and not according to our article on Lambda calculus. In Lambda calculus, '.' is used as a syntactic element in lambda abstractions. In Haskell (prelude), f . g = \ x -> f (g x), that is function composition like the "circle operator" in mathematical analysis. --Anon.
[edit] Code examples
I decided to clean up the examples section a bit, which I have now done. The factorial function now has a proper type declaration (best to do these things right...) and a line-by-line explanation.
It's been mentioned previously about explaining the methods behind some of the more involved examples shown (particularly, why the linear-time Fib sequence is so elegant). I'm not sure we should turn Wikipedia into another Haskell tutorial, but if anyone knows places off-site which explain how they work, that would be good. Opinions, anyone?
--Ithika (not yet got account) 81.131.174.201 16:59, 4 September 2005 (UTC)
- I hope you don't mind the small tweaks I made to the function definition. --TuukkaH 17:30:29, 2005-09-04 (UTC)
- The RPN example is indeed elegant, but probably not all that helpful to somebody trying to work out what's good and bad about Haskell --Alang
[edit] Factorial function
Since we already use the factorial function as an example, should we also link to "The Evolution of a Haskell Programmer", which provides 20+ increasingly elaborate implementations of this same function? --Tobias Bergemann 08:36, 20 October 2005 (UTC)
Re the fac example, I'm an Haskell novice, but it seems to me that the guard expression in
fac :: Integer -> Integer fac 0 = 1 fac n | n > 0 = n *fac (n-1)
serves no purpose? The zero case is handled and the only other possibility is n<0 which isn't checked for anyway...could you not replace with the following?
fac :: Integer -> Integer fac 0 = 1 fac n = n *fac (n-1)
--Jaybee 21:06, 26 April 2006
- Well, it serves the purpose that we get to give an example of a guard. Besides, I wouldn't appreciate claiming something holds for all integers when it only holds for positive integers. And when you're running this as a program, "non-exhaustive patterns" is a nicer note that something went wrong than infinite recursion. --TuukkaH 20:45, 26 April 2006 (UTC)
-
- Makes sense, thanks --Jaybee
[edit] Explanations of the examples
Can someone knowledgeable about Haskell please add some commentary to the "More Complex Examples" section, similar to what is there for the "Examples" section? The syntax is a bit abstruse for those not already familiar with the Haskell language. Kwertii 18:46, 20 February 2006 (UTC)
- I suppose the point is that those who are intrigued by the examples can turn to the language definition and tutorials for syntax and pure functional programming in general. I don't think we can teach all in this article, but we could try to add notes on what's the point in each example and links for more info elsewhere in Wikipedia. The parallel list comprehension link will help something, algebraic data type has something on lists although they should have an article of their own, corecursion isn't very helpful for the moment. --TuukkaH 20:05, 20 February 2006 (UTC)
I've put in a bit about the linear-time Fibonacci sequence. It seemed that lazy evaluation and infinite lists were the relevant points to make about that bit of code. I don't really know what to say about the others though. The RPN calculator could, I'm sure, be written that way in most functional languages? Ithika 16:48, 11 March 2006 (UTC)
[edit] Why nobody learns Haskell
I now have some insight into Haskell, and also some insight into why it is not more popular.
Take a simple example such as fib:
Hugs.Base> fibs = 0 : 1 : [ a+b | a <- fibs | b <- tail fibs ] ERROR - Syntax error in input (unexpected `=') Hugs.Base>
or
Prelude> fibs = 0 : 1 : [ a+b | a <- fibs | b <- tail fibs ] <interactive>:1:5: parse error on input `=' Prelude>
If I can't get a simple 1-line example to run with copy and paste, I'm not likely to want to continue. After reading more books I discovered that
Prelude> let fibs = 0 : 1 : (zipWith (+) fibs (tail fibs))
did indeed work (the list comprehension version doesn't work without special flags).
Why do we have examples which do not work in the standard environment? --njh 03:51, 3 January 2006 (UTC)
- I'm not sure how relevant this discussion is to this forum, but in general, you can't expect to be able to paste code snippets into an interpreter and expect that they will work. The "fibs = whatever" definitions are legal as part of a compiled program. The interactive Hugs and GHCI require different syntax for definitions. The list comprehension version indeed doesn't work without a flag, as the article mentions: "The same function, presented with GHC's parallel list comprehension syntax:". Haskell is certainly not a language for everybody; writing Haskell programs requires attention and thought, certainly more attention than the minimal amount of attention requires to realize that Haskell interpreters require the "let" syntax for definitions and that GHC extensions have to be enabled using -fglasgow-exts. --Catamorphism 03:59, 3 January 2006 (UTC)
-
- I suggest we remove the section which talks about how to get the code snippets to work in various interpreters and compilers. This is meant to be an encyclopaedia, not a tutorial. Hence, the reason for the inclusion of code examples should be to demonstrate what Haskell code looks like. Choosing a programming language at random and thinking, "what kind of language is that?" is best answered by examples on the page. But no-one goes to an encyclopaedia to learn functional programming (or they shouldn't, anyway). By way of comparison, the *ML language-family pages tend to introduce code first, then demonstrate interactive interpreters separately. Opinions? Ithika 18:52, 20 January 2006 (UTC)
-
-
- I thought the remarks are in place; I would say that in general, you can paste code examples into an interpreter and toy with them. The definition-assignment differentiation and the let clause for monads are something that easily trick anyone wanting to have a look at the language. --TuukkaH 19:43, 20 January 2006 (UTC)
-
-
-
-
- First I have to disagree with njh. The interpreter is not the standard environment. The 'standard environment' is putting the examples in a .hs file and then loading/running it with the interpreter. Secondly, I do not think it is the purpose of Wikipedia to explain this, as strictly speaking is not part of the Haskell language and as Wikipedia is not a how-to guide. If people want to learn Haskell from scratch, writing a Wikibook for them would be a better idea, in my opinion. Cheers, —Ruud 17:09, 28 January 2006 (UTC)
-
-
-
-
-
-
- And second?
- "If I can't get a simple 1-line example to run with copy and paste, I'm not likely to want to continue." The great thing about computers, the web, hypertext and Wikipedia is that you don't have to leave out important notes because they don't fit in the margin. You can copy and paste, and Haskell even has interpreters so you're able to directly try out on a computer instead of trying to evaluate in your mind. The value of the examples is much less if they're limited to appearances. I understand your fear of How-Tos, that's why I made the note into a box outside the text flow. --TuukkaH 18:10, 28 January 2006 (UTC)
-
-
-
-
-
-
-
-
- I do not consider the "green thing" outside the text flow, on the contrary. I remain by my point that it is unencyclopedic, and that we shouldn't include it just because we can. Wikibook would be the perfect place for this, but on Wikipedia we shouldn't bother the casual reader with a implementation-specific how-to only there to satisfy the person that is to lazy to read the manual of the Haskell implementation he/she has chosen to test the examples with. (I apologize for stating it so bluntly, not being a native writing means I usually have problems with phrasing such thing more eloquently) —Ruud 18:19, 28 January 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
- For some reason, you want to be exclusive and I want to be inclusive. We gain a lot if readers can try out the examples. If you have read enough on Haskell to know why to transform the examples and how, you're not in the majority of our audience any more. "The Glasgow Haskell Compiler User's Guide, Version 6.2: 3.4.2. Using do-notation at the prompt" won't tell you what you need to know even if you're not lazy. In your latest edit and here, you don't seem to consider that we're talking about different contexts in standard Haskell. There's the declaration top level of .hs files and there's the do notation level. That's confusing. It's a de facto standard that Haskell interpreters allow only expressions and do statements, and limit them to one-liners. --TuukkaH 20:44, 28 January 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
- I'm not being exclusive, I just think such material belongs in a Wikibook, not in an encyclopedic article. Furthermore, the Haskell interpreters were never meant to accept a program from the keyboard, but always through a file, just as is the case with C, Java and Prolog. This is probably the reason why the i in GHCi stands for interactive and not interpreter. Maybe it would be better not to inform people how to transform programs so they can be typed directly in the 'interpreter' be tell them how to do it the right way, which doesn't require that much more effort. —Ruud 21:02, 28 January 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
- While Hugs and GHC are by far the most widely used compilers/interprets for Haskell, I would consider putting instructions on how to use them in this article the same as putting instructions in the C programming language article on how to execute the examples in Microsoft Visual C. —Ruud 18:25, 28 January 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
- And yet that page does indeed have some notes about getting the examples to work on different compilers (note that this is perhaps an unfair comparison as C does not, in general, have an interpreter). For example: The above program will compile correctly on most modern compilers that are not in compliance mode. However, it produces several warning messages when compiled with a compiler that conforms to the ANSI C standard. . Furthermore, looking at Lisp programming language, Lua programming language, OCaml, Python programming language, Perl and Ruby programming language, the examples all work in the Debian provided interpreters either without further note, or with specific instructions on how to use. It's a shame that Haskell, a language which is otherwise quite elegant, gets the interpreter so wrong. Is there a simple explanation as to why the interpreters differ from the compiler? njh 19:51, 28 January 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Because you will normally only use the interpreter to test functions you have written in your source file with different parameters. This only requires a single line. Even the most simple program will require several lines which the interpreter won't accept (unless you transform the program into a single line). The normal way is to type your program in an editor, save it to a .hs file, start the interpreter with
ghci Example.hs
, and typemain
to start it. Giving the one-line hack as the first example will only mislead reader as it gives the impression that Haskell has an awkward curly-bracket style syntax, which normally does not. In this respect the interpreter might be wrong for new users but is much better suited for "real" users. For example the interpreter allows you to do more than just execute types in code, such as running the type inferencer on a specific function or browsing modules, which as far as I know th Perl interpreter won't let you. —Ruud 20:10, 28 January 2006 (UTC)
- Because you will normally only use the interpreter to test functions you have written in your source file with different parameters. This only requires a single line. Even the most simple program will require several lines which the interpreter won't accept (unless you transform the program into a single line). The normal way is to type your program in an editor, save it to a .hs file, start the interpreter with
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- So the Haskell interpreters are broken as they can't deal with multiple line input? Has someone submitted a bug report on this? I think the article should warn people that the Haskell interpreters have an awkward hack to get around their lack of multi-line editing. Perl types are not inferred, they are attached to the variable name (in the form of @, $ etc) and set at declaration. I'm sure that if Perl was in the least bit interested in type inference there would be a whole pile of modules and notation to deal with it... A better example might be to compare to OCaml. njh 22:32, 6 February 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No, the interpreters are not broken. They require different syntax and this is well-documented in their manuals. Catamorphism 22:56, 6 February 2006 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- It wouldn't make any sense to allow function definitions using the ordinary syntax in a Haskell interpreter. Remember, Haskell is a static language. It's not possible to change an existing definition without recompiling the module it's in. The syntax in the interpreter is different because it's actually creating a local binding, not a definition. Cadr 22:24, 20 February 2006 (UTC)
-
-
-
-
-
-
-
[edit] One-line syntax for definitions
In the Examples section, there is a one-line definition for the fac function. According to Aaron McDaid, the syntax for this definition doesn't work in Hugs. It does work in Ghci. I only use Ghci and had assumed that the different interpreters used the same syntax for entering a definition in one line. If different interpreters really have different syntaxes for this, perhaps we should just get rid of the one-line example, and remove details that are specific to specific Haskell interpreters, as that would be getting rather non-encyclopedic. --Catamorphism 20:47, 1 March 2006 (UTC)
- this is a comment I had put in another thread. It really belongs here as a response to Catamorphism
- The second sample of code on the article was
- let { fac 0 = 1; fac n | n > 0 = n *fac (n-1) }
- let fac 0 = 1; fac n | n > 0 = n *fac (n-1)
- fac 0 = 1; fac n | n > 0 = n *fac (n-1)
- The article did say (#1), then (#3) (my version), now it's (#2) as of 20:49, 1 March 2006 (UTC).
- I can't get either of the first (#1) or (#2) to work in hugs or runhugs, whereas (#3) does work. With (#3) I do
- fac 5 where fac 0 = 1; fac n | n > 0 = n *fac (n-1)
- to use it in hugs.
- So basically, is there a portable version that'll work in as many compilers and interpreters as possible? --Aaron McDaid (talk - contribs) 20:49, 1 March 2006 (UTC)
-
- The parallel list comprehension link will help something, algebraic data type has something on lists although they should have an article of their own, co-recursion isn't very helpful for the moment. --TuukkaH 20:05, 20 February 2006 (UTC)
-
-
- I've put in a bit about the linear-time Fibonacci sequence. It seemed that lazy evaluation and infinite lists were the relevant points to make about that bit of code. I don't really know what to say about the others though. The RPN calculator could, I'm sure, be written that way in most functional languages? --Ithika 16:48, 11 March 2006 (UTC)
-
-
-
-
- Hi guys, I was wrong in March [1] when I said some of the one-line examples didn't work in hugs. I've been able to get them working. Basically this works in hugs let { fac' 0 = 1; fac' (n+1) = (n+1) * fac' n} in fac' 5 (Note the "in fac' 5" on the end). The only real issue with the command line hugs interpreter is that you cannot define a function in one command from the keyboard which you then use in a later command - you have to put both on one line as above. ghci,ghc, and runhugs don't have this restriction. That'll teach me not to edit pages before I know the language well :-). I'll describe a suggested edit here on the talk page later - I want to make sure hugs users can see how to get the examples working. Aaron McDaid (talk - contribs) 15:01, 9 September 2006 (UTC)
-
-
Resetting indent. This is what I'm thinking of changing near the start of the the Haskell_programming_language#Examples section:
-
- ... first few lines ...
-
let { fac 0 = 1; fac n | n > 0 = n * fac (n-1) }
- in ghci, then type this to run the function and see the output 120
-
fac 5
- In hugs, you need to enter the function definition on the same line where you call it to get the same result:
-
let { fac 0 = 1; fac n | n > 0 = n * fac (n-1) } in fac 5
I'll wait a while before making this change. Thanks in advance for any feedback. I suppose we don't want to turn this into a full user manual for hugs and ghc(i) Aaron McDaid (talk - contribs) 15:24, 9 September 2006 (UTC)
[edit] Infobox
Is the infobox correct in asserting that there are no dialects of Haskell? Then why the difference between '98 and all the others? —The preceding unsigned comment was added by Marudubshinki (talk • contribs) 21:48, 11 April 2006 (UTC2)
[edit] Unclear criticism
This really needs to be clarified:
- Haskell has many advanced features not found in other programming languages; these features can and have been criticized for making the language more complex and difficult to understand.
As it stands suggests that the problem is that Haskell has differences from other languages and that the critic simply wants to suppress diversity. This would not be rational criticsm, because it suggests that the ideal is that only one unique language exist. The problem may have been misphrased to avoid the real criticsm, or it may have been included without there being any real merit behind it. --ToobMug 01:37, 24 April 2006 (UTC)
- I think the key modifier is "advanced" (monads, anyone?). I agree that the formulation needs to be made more precise. Fredrik Johansson 06:33, 24 April 2006 (UTC)
[edit] "A History of Haskell" paper
Simon Peyton Jones, Paul Hudak, John Hughes, and Philip Wadler are currently working on a paper describing the history of Haskell. This paper is currently in draft state, but will be submitted to the History of Programming Languages conference (HOPL'07) once it is finished. The draft is publically available and already is a very valuable source of information. — Tobias Bergemann 09:55, 4 August 2006 (UTC)
[edit] Requested move
Haskell programming language → Haskell (programming language) – Conformance with WP naming conventions LotLE×talk
- I've just moved it as per the decision below, and fixed up the double redirects. Aaron McDaid (talk - contribs) 11:37, 11 September 2006 (UTC)
-
- The discussion preceeding the move can be found at Wikipedia talk:WikiProject Programming languages/Renaming poll.
[edit] delete wxHaskell?
I recently started an article for wxHaskell, one of the many bindings for WxWidgets. It has been nominated for deletion as it "Does not assert notability". Please have a look at it and improve it if possible, especially if you are a fan of wxHaskell. Aaron McDaid (talk - contribs) 13:33, 11 September 2006 (UTC)
[edit] confusing sentence
"This sentence does not make much sense: he Glasgow Haskell Compiler compiles to native code on a number of different architectures—as well as to ANSI C—using C-- as an intermediate language." --using c-- ?? 128.12.108.147 13:12, 4 March 2007 (UTC)
[edit] Concurrent Haskell
What's the status of Concurrent Haskell? I've found this reference:
PEYTON JONES, S., GORDON, A., AND FINNE, S. Concurrent Haskell. In 23rd ACM Symposium on Principles of Programming Languages (POPL’96), pp. 295–308.
and it's also recently described in Composable Memory Transaction, 2006.
Bartosz 01:55, 7 March 2007 (UTC)
[edit] = is non-kludgy way to implement the type schema Z/mZ (m integer >1)
Say in haskell I wanted to implement the types Z/mZ i.e. "integers mod m" for all integeres m>1. Naturally I'd want to implement the arithmetic operator / for these types. Context: In 1992-3 I faced this prob while writing haskell code for smith reduction for all integral domains where it makes sense. (Which in turn was part of a homological-algebra package). The best I could do was to define a single type Zmod, and replace the binary operator \a \b a/b by a ternary function \a \b \m "a/b mod m" . Which meant that even for the integer type, I had to replace (/) by that ternary function and pass it a dummy argument that it ignored.
Was I missing something then? Is there in newer haskell versions a way to define type schemas? (ie nonconstant type-valued functions of at least one argument). [I suppose not - is Type yet a Type in Haskell?] Or at least to do the stuff mentioned in the above paragraph in a less kludgy way? I guess not - types are untermenschen in haskell, subject to compulsory type checks which had better be "finite" - "infinite" type checking being "inefficient" - so e.g. you cannot write the fixedpoint operator named after Haskell Curry in the language named after Haskell Curry. (nor can you write the noniterative nonrecursive factorial program that works by passing a function as an argument to itself, 'cause that function would have "infinite" type. —The preceding unsigned comment was added by 59.93.195.26 (talk) 03:51, 29 March 2007 (UTC).
- This isn't the right place for programming advice, so email for follow up. What it sounds like you want is [2]. jbolden1517Talk 13:19, 29 March 2007 (UTC)
[edit] Pronounciation
Perhaps a pronounciation ought to be given? I suspect it's probably pronounced as the last name of "Beaver" Cleaver's buddy Eddie, but in my head it always sounds closer to Pascal (programming language). --Belg4mit 18:37, 7 April 2007 (UTC)
[edit] Code examples
Heh, whatever. These code examples are all taken from some sort of freshman Haskell course and are nothing like Haskell code looks like out there in the wild. I note my attempt to add such an example and clean up the current mess has been summarily reverted. —The preceding unsigned comment was added by 193.77.153.149 (talk) 11:43, 11 May 2007 (UTC).
- I thought your example was a good one. I said as much. I think it would be useful for wikibooks. But it involved several complex ideas and it was highly monadic. Moreover you deleted other examples. jbolden1517Talk 11:47, 11 May 2007 (UTC)
- Ooooo Monads, those are so scary, don't you think so? I thought about mentioning uns*fePe**orm*O, but thankfully I regained my senses and removed it. God forbid we show Haskell is good for anything but producing Fibonacci numbers, a computing concept so important it obviously has to be demonstrated in several slightly different but equivalent ways. Similarly we should keep the verbose idiocy about how to get the examples running in Hugs and ghci because obviously various people come here and we should really aim for the lowest common denominator persons. —The preceding unsigned comment was added by 193.77.153.149 (talk) 12:41, 11 May 2007 (UTC).
If you would like to discuss this:
- Get an account
- Sign your posts with 4~ 's
- Lose the tone of superiority.
jbolden1517Talk 13:23, 11 May 2007 (UTC)
- Who made you king of Wikipedia that you may make demands in such a manner? —The preceding unsigned comment was added by 193.77.153.149 (talk) 17:27, 11 May 2007 (UTC).
- I'm not sure if he's actually the King of Wikipedia, but his demands (at least the last two) reflect established Wikipedia policies. See WP:TALK, and for both points, and specifically WP:CIVIL for #3. As for the first demand, it's a bit easier for you to carry on discussion if you have an account, but you're certainly welcome to remain anonymous. Staecker 17:43, 11 May 2007 (UTC)
[edit] 'Influenced: Python'
I don't really see what aspects of Python are owed in particular to Haskell. Perhaps lazy streams, but is there any evidence that it did so directly? Jogloran 13:14, 13 May 2007 (UTC)
- From the Python page: Python 2.0 borrowed a major feature from the functional programming language Haskell: list comprehensions. 90.4.118.238 05:44, 24 May 2007 (UTC)
[edit] Multiple dispatch?
Would you folks say that Haskell supports multiple dispatch? If so, could you update that article? I'm not too sure. It was this section of that article that piqued my curiousity:
- (from multiple dispatch) "In languages with multiple dispatch, all the arguments are treated symmetrically in the selection of which method to call. Matching recognizes first, second, third, etc. position within the call syntax, but no one argument "owns" the function/method carried out in a particular call."
One of the things I like about Haskell is that it supports (something like) the above. In Haskell, the first argument isn't special, and typeclasses can be used on any argument:
- meth :: (A a, B b) => x -> a -> b
Aaron McDaid (talk - contribs) 17:20, 16 December 2007 (UTC)
Single and multiple dispatch are both forms of dynamic dispatch. They come out of the object oriented world where the function (method) to be dispatched to is unknowable until runtime (hence the "dynamic"). In Haskell type classes the choice of function is made statically. As such, the terminology used by Haskellers to describe that kind of behavior is "overloading" and shares more similarities with the statically bound overloading available in languages like C++ and Java than the multiple dispatch of Common Lisp and Dylan or the dynamic single dispatch overriding of C++/Java. One major (and crucial) difference between Haskell type class overloading and C++/Java overloading is that in Haskell the choice of which overloaded function is called may depend on nothing more than the static type of the result. In C++/Java the choice of overloaded method depends on the static types of the parameters only. See the article on monads in functional programming - different unit functions must be chosen based entirely on the expected return type. —Preceding unsigned comment added by 24.94.4.15 (talk) 14:14, 8 February 2008 (UTC)
[edit] Influence on Java
I'm not sure that Java generics rise to the level of an influence from Haskell. True, there is the Philip Wadler connection, but IMHO Java's generics are just a form of parametric polymorphism (which pre-dates Haskell, e.g., in ML and Miranda) with the syntactic flavor of C++ templates. Clconway (talk) 23:22, 4 January 2008 (UTC)
[edit] Working examples, please
I downloaded GHCi from haskell.org, tried the examples on the Wikipedia page, and found most of them didn't work. This is hugely confusing. One of the examples with "let" that's recommended for Hugs worked for me, which is also confusing since I'm not running Hugs, and the page says GHCi doesn't have that restriction.
I see from the comments above that this problem has come up before. I respectfully suggest that the examples should work with the standard Haskell system. Billgordon1099 (talk) 05:46, 7 June 2008 (UTC)