Difference between revisions of "Talk:1312: Haskell"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(reorder comments by timestamp, reply)
Line 4: Line 4:
 
I will, however, leave the above word "variable" in the explanation, because I can't come up with a concise way of explaining the above.
 
I will, however, leave the above word "variable" in the explanation, because I can't come up with a concise way of explaining the above.
 
--[[User:Someone Else 37|Someone Else 37]] ([[User talk:Someone Else 37|talk]]) 09:07, 3 January 2014 (UTC)
 
--[[User:Someone Else 37|Someone Else 37]] ([[User talk:Someone Else 37|talk]]) 09:07, 3 January 2014 (UTC)
 +
 +
:"Expression?" I don't know Haskel, but that's what I would call it in another functional language. --[[User:Rael|Rael]] ([[User talk:Rael|talk]]) 16:31, 3 January 2014 (UTC)
 +
::That's a little imprecise, as it doesn't capture the idea of binding a value to a single symbol.  [[Special:Contributions/108.162.231.13|108.162.231.13]] 17:03, 3 January 2014 (UTC)
 +
 
:The sentence you quote is entirely correct...  but might itself require further explanation!
 
:The sentence you quote is entirely correct...  but might itself require further explanation!
 
:*Haskell variables aren't mutable, but they are nonetheless referred to as "variables".  It's an appeal to the (earlier, after all) use of the word in maths, rather than in imperative programming languages.  (No shortage of variables in algebra, geometry, calculus, topology...  And no mutation involved.)  One might equally say "symbol", "constant", or indeed "symbolic constant".
 
:*Haskell variables aren't mutable, but they are nonetheless referred to as "variables".  It's an appeal to the (earlier, after all) use of the word in maths, rather than in imperative programming languages.  (No shortage of variables in algebra, geometry, calculus, topology...  And no mutation involved.)  One might equally say "symbol", "constant", or indeed "symbolic constant".
 
:*One can bind the fibonaccis to a variable (... constant, 0-place definition, etc) quite happily.  In fact, that's the idiomatic way to do it, as it avoids the degenerate complexity of a naive recursive function.  It's still evaluated lazily, all the same.  (Meaning that it will take an infinite amount of memory...  if you run it for an infinite amount of time, and never "consume" the result in any way.)
 
:*One can bind the fibonaccis to a variable (... constant, 0-place definition, etc) quite happily.  In fact, that's the idiomatic way to do it, as it avoids the degenerate complexity of a naive recursive function.  It's still evaluated lazily, all the same.  (Meaning that it will take an infinite amount of memory...  if you run it for an infinite amount of time, and never "consume" the result in any way.)
 
:*Equally, one can regard such top-level symbol definitions as functions with no arguments, if that's more helpful.  [[Special:Contributions/108.162.231.13|108.162.231.13]] 16:42, 3 January 2014 (UTC)
 
:*Equally, one can regard such top-level symbol definitions as functions with no arguments, if that's more helpful.  [[Special:Contributions/108.162.231.13|108.162.231.13]] 16:42, 3 January 2014 (UTC)
 
:"Expression?" I don't know Haskel, but that's what I would call it in another functional language. --[[User:Rael|Rael]] ([[User talk:Rael|talk]]) 16:31, 3 January 2014 (UTC)
 
  
 
Does anyone have a clue what the Incomplete flag refers to? This seems like a pretty good explanation to me. --[[User:Mynotoar|Mynotoar]] ([[User talk:Mynotoar|talk]]) 11:22, 3 January 2014 (UTC)
 
Does anyone have a clue what the Incomplete flag refers to? This seems like a pretty good explanation to me. --[[User:Mynotoar|Mynotoar]] ([[User talk:Mynotoar|talk]]) 11:22, 3 January 2014 (UTC)
  
 
Example programs written in Haskell are: pandoc, universal markup converter; git-annex, tool to manage large files in git DVCS. --[[User:JakubNarebski|JakubNarebski]] ([[User talk:JakubNarebski|talk]]) 11:37, 3 January 2014 (UTC)
 
Example programs written in Haskell are: pandoc, universal markup converter; git-annex, tool to manage large files in git DVCS. --[[User:JakubNarebski|JakubNarebski]] ([[User talk:JakubNarebski|talk]]) 11:37, 3 January 2014 (UTC)

Revision as of 17:03, 3 January 2014

"Thus, it is possible to have a variable representing the entire infinite list of Fibonacci numbers." Except that Haskell has no variables- nothing is mutable, as they say. You could certainly write a function that generates an infinite list of Fibonacci numbers when called (and lazily evaluated later), but it won't be bound to a variable. If it was, then the list would take up an infinite amount of memory, and lazy evaluation would be pointless.

I will, however, leave the above word "variable" in the explanation, because I can't come up with a concise way of explaining the above. --Someone Else 37 (talk) 09:07, 3 January 2014 (UTC)

"Expression?" I don't know Haskel, but that's what I would call it in another functional language. --Rael (talk) 16:31, 3 January 2014 (UTC)
That's a little imprecise, as it doesn't capture the idea of binding a value to a single symbol. 108.162.231.13 17:03, 3 January 2014 (UTC)
The sentence you quote is entirely correct... but might itself require further explanation!
  • Haskell variables aren't mutable, but they are nonetheless referred to as "variables". It's an appeal to the (earlier, after all) use of the word in maths, rather than in imperative programming languages. (No shortage of variables in algebra, geometry, calculus, topology... And no mutation involved.) One might equally say "symbol", "constant", or indeed "symbolic constant".
  • One can bind the fibonaccis to a variable (... constant, 0-place definition, etc) quite happily. In fact, that's the idiomatic way to do it, as it avoids the degenerate complexity of a naive recursive function. It's still evaluated lazily, all the same. (Meaning that it will take an infinite amount of memory... if you run it for an infinite amount of time, and never "consume" the result in any way.)
  • Equally, one can regard such top-level symbol definitions as functions with no arguments, if that's more helpful. 108.162.231.13 16:42, 3 January 2014 (UTC)

Does anyone have a clue what the Incomplete flag refers to? This seems like a pretty good explanation to me. --Mynotoar (talk) 11:22, 3 January 2014 (UTC)

Example programs written in Haskell are: pandoc, universal markup converter; git-annex, tool to manage large files in git DVCS. --JakubNarebski (talk) 11:37, 3 January 2014 (UTC)