<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:osnews="http://www.osnews.com/rss2#">
	<channel>
		<title>OSNews: </title>
		<link>http://www.osnews.com/story/16570/Why_Haskell_</link>
		<description>Exploring the Future of Computing</description>
		<language>en-us</language>
		<copyright>Copyright 2001-2012, David Adams</copyright>
		<webMaster>adam+nospam@osnews.com</webMaster>
		<lastBuildDate>Thu, 16 Feb 2012 03:24:24 GMT</lastBuildDate>
		<image>
			<url>http://www.osnews.com/images/osnews.gif</url>
			<title>OSNews.com</title>
			<link>http://www.osnews.com</link>
		</image>
		<item>
			<title>Introductory article about Functional Programming</title>
			<link>http://www.osnews.com/thread?185787</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185787</guid>
			<description>If you are interested in functional programming and that you want to read a good article that doesn't use strange terms without explaining them (currying?) or vaguely explain them (Monad?). Which doesn't contain stuff like &quot;it's equivalent to '((&amp;#955; x . (&amp;#955; y . y &lt; x) x)' in lambda calculus&quot; or which isn't in a &quot;white paper&quot; format ( <a href="http://www.math.chalmers.se/~rjmh/Papers/whyfp.pdf" rel="nofollow">http://www.math.chalmers.se/~rjmh/Papers/whyfp.pdf</a>  )<br />
read this : <br />
<a href="http://www.defmacro.org/ramblings/fp.html" rel="nofollow">http://www.defmacro.org/ramblings/fp.html</a><br />
Read it. Seriously, do it. <br />
Even if you don't plan to program anything in a functional language at all, it's still damn interesting to read.</description>
			<pubDate>Mon, 27 Nov 2006 19:53:00 GMT</pubDate>
			<author>donotreply@osnews.com (Monkeyget)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>...</title>
			<link>http://www.osnews.com/thread?185815</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185815</guid>
			<description>I read it, lost me right off the bat around paragraph four or so ...<br />
<br />
Maybe if I was already a elite programmer that understood everything and was looking at it as a 'additional' language then it may be obvious.</description>
			<pubDate>Mon, 27 Nov 2006 20:49:00 GMT</pubDate>
			<author>donotreply@osnews.com (deanlinkous)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>functional language styling</title>
			<link>http://www.osnews.com/thread?185819</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185819</guid>
			<description>My perspective on 'functional' languages is that functional can also be a style applied to a language, not an attribute implemented into a language. For instance, it is possible to only use a subset of a language like C or LISP while coding in a functional style. When you code in a functional style you can achieve 90% of the benefits of a functional language when coding without global variables, and minimizing local variable use, and returning computed values instead of storing them. Though this is not so true with VB, some languages can be mostly programmed in a functional style and get the benefits therein.</description>
			<pubDate>Mon, 27 Nov 2006 20:55:00 GMT</pubDate>
			<author>donotreply@osnews.com (AndrewZ)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>I ask the same thing...</title>
			<link>http://www.osnews.com/thread?185831</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185831</guid>
			<description>Why Haskell?</description>
			<pubDate>Mon, 27 Nov 2006 21:18:00 GMT</pubDate>
			<author>donotreply@osnews.com (tomcat)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: functional language styling</title>
			<link>http://www.osnews.com/thread?185840</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185840</guid>
			<description>Some languages make coding in a functional style easier than others. For example, its ALMOST possible to code in a functional style in C++, and indeed certain STL idioms beg for a functional style, but without lambdas, the idea is pretty dead in the water. Not being able to implement the major functional primitives (map, reduce, curry, etc) in a generic and sensical way is a major impediment to doing functional programming comfortably in a language.Edited 2006-11-27 21:34</description>
			<pubDate>Mon, 27 Nov 2006 21:34:00 GMT</pubDate>
			<author>donotreply@osnews.com (rayiner)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: I ask the same thing...</title>
			<link>http://www.osnews.com/thread?185860</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185860</guid>
			<description>Agreed, the author's raised the point but didn't really answer..<br />
<br />
As for 'modular programming', there is a paper on Scala where the author says that Scala's mixin feature reduced by two the number of line needed to make a compiler is Haskell better in this respect?<br />
I don't know.</description>
			<pubDate>Mon, 27 Nov 2006 22:10:00 GMT</pubDate>
			<author>donotreply@osnews.com (renox)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Don't learn Haskell</title>
			<link>http://www.osnews.com/thread?185863</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185863</guid>
			<description>I learned some basic Haskell and now every time I find myself programming in a different language I keep finding myself facing a nasty problem thinking, damn it if only I was using Haskell I could solve this in 2-3 lines.  Very infuriating!  You really should avoid putting yourself in the same situation <img src="/images/emo/smile.gif" alt=";)" /> <br />
<br />
That being said whenever I'm stuck with a problem in Haskell I keep thinking to myself, damn it if only I was using Python I could solve this in 2-3 lines.</description>
			<pubDate>Mon, 27 Nov 2006 22:25:00 GMT</pubDate>
			<author>donotreply@osnews.com (dagw)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Unicode</title>
			<link>http://www.osnews.com/thread?185930</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185930</guid>
			<description>Wake me up when the libraries of the standard haskell implementations have decent unicode support.</description>
			<pubDate>Tue, 28 Nov 2006 02:30:00 GMT</pubDate>
			<author>donotreply@osnews.com (msundman)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Introductory article about Functional Programming</title>
			<link>http://www.osnews.com/thread?185943</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185943</guid>
			<description>Thanks for posting those.  I was going to post them if someone asked the old &quot;why functional&quot; question.<br />
<br />
The Defmacro article really hits the nail on the head for people that don't have any prior experience with functional languages.<br />
<br />
If you're wondering &quot;why functional&quot;, read both of those links.</description>
			<pubDate>Tue, 28 Nov 2006 03:29:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: ...</title>
			<link>http://www.osnews.com/thread?185944</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185944</guid>
			<description>Functional programming is a completely different frame of thinking than traditional programming. It's something you either get or don't get. Most people really don't get it.<br />
<br />
For the people who do get it, it seems to be a really great method of programming. However, even among people with Computer Science degrees, very few people grasp it.<br />
<br />
Probably the biggest problem with functional programming is that the people who do get it refuse to people that it just doesn't click for everyone else. Saying &quot;It's as simple as &quot; to the average programmer is like saying &quot;It's as easy as &quot; to the average computer user.<br />
<br />
As for myself, I can see where it's useful for doing calculations and math brain teaser type problems, but for your average everyday computer tasks, I can't even begin to see how it would work.</description>
			<pubDate>Tue, 28 Nov 2006 03:29:00 GMT</pubDate>
			<author>donotreply@osnews.com (edwdig)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: I ask the same thing...</title>
			<link>http://www.osnews.com/thread?185946</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185946</guid>
			<description>As for 'modular programming', there is a paper on Scala where the author says that Scala's mixin feature reduced by two the number of line needed to make a compiler is Haskell better in this respect?<br />
I don't know.<br />
<br />
Note that the most complete implementation of Perl 6 was written in Haskell.  Haskell is a very good language for writing compilers and parsers.</description>
			<pubDate>Tue, 28 Nov 2006 03:36:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Why functional</title>
			<link>http://www.osnews.com/thread?185954</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185954</guid>
			<description>If I could sum up an answer to &quot;Why functional?&quot; in a simple statement, it would be &quot;It lets you reason about your program better&quot;.  <br />
<br />
Let me give a little example to explain this:<br />
<br />
my_map fn [] = []<br />
my_map fn (x:xs) = fn x : my_map fn xs<br />
<br />
This is your standard map function in Haskell.  Notice that there appears to be two definitions of it.  The first one takes the function to apply to the elements of the list and an empty list.  You'll notice the second one has the (x:xs) as the list.  All this does is decompose the list into it's head (x) and it's tail(xs).  If map is handed an empty list, it just return an empty list.  If not, it gives you the head and tail of the list and you go about your business applying the function recursively.<br />
<br />
What's cool about this is that I don't have to put some conditional logic in the same function definition to check for the empty list.  Haskell handles that for me.  <br />
<br />
That's the beauty of pattern-matching.  I can decompose my functions into manageable, piece-wise components.  But that is just the tip of the iceberg when it comes to pattern matching.<br />
<br />
Or to put it another way, a traditional OO programmer will recognize a big long switch statement as a code smell, begging to be refactored into something more polymoprhic, where the compiler will handle the &quot;switching&quot; for you.<br />
<br />
That's the way I look at pattern-matching, and functional decomposition.  It's letting the compiler free you from hand-coding if-then logic.</description>
			<pubDate>Tue, 28 Nov 2006 03:54:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: ...</title>
			<link>http://www.osnews.com/thread?185977</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185977</guid>
			<description>Functional programming is at its essence quite simple. IMHO, languages like Haskell aren't great introductions to functional programming, because they bury it under concepts like monads, referential transparency, strictness, pattern matching, elaborate type systems, etc. <br />
<br />
At its heart, functional programming requires one thing: lambda. A lambda is just a function that can be passed around as a value, with the usual convenience that can capture variables in its scope if written inline inside another function. <br />
<br />
With just that one concept, you can write all sorts of cool functional programs without ever grokking monads. Consider the simple example of finding the maximum value in a vector. What's the imperative code look like?<br />
<br />
mx = vec[0]<br />
for i in vec<br />
  mx = max(mx, i)<br />
<br />
(Assume you have a max that just takes two arguments)<br />
<br />
What's the functional code look like?<br />
<br />
mx = reduce(max, vec)<br />
<br />
Just at the very practical level, you get rid of two lines of code and a level of nesting. You've now also eliminated all mutable state, but you can benefit from this without ever knowing what &quot;mutable&quot; means!</description>
			<pubDate>Tue, 28 Nov 2006 05:05:00 GMT</pubDate>
			<author>donotreply@osnews.com (rayiner)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Ruby</title>
			<link>http://www.osnews.com/thread?185993</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?185993</guid>
			<description>Yeah, learn ruby instead...</description>
			<pubDate>Tue, 28 Nov 2006 06:01:00 GMT</pubDate>
			<author>donotreply@osnews.com (diegoviola)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Ruby</title>
			<link>http://www.osnews.com/thread?186004</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186004</guid>
			<description>Yeah, learn ruby instead...<br />
<br />
Yes, listen to the blogosphere.</description>
			<pubDate>Tue, 28 Nov 2006 07:19:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[3]: ...</title>
			<link>http://www.osnews.com/thread?186042</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186042</guid>
			<description>Please mod the above comment up.<br />
<br />
Indeed, the benefit of FP is lambda. Put lambda in a any imperative language, and watch how many things in it become quite simpler.<br />
<br />
Haskell is not the only functional language...there is also ML, which is simpler, Erlang, which excels in distributed environments, and of course Lisp/Scheme, which thrives in providing solutions where other languages fail.<br />
<br />
One thing that irritates me though with Haskell is referential transparency: it makes things more difficult than it ought to be. I do not believe assignment/destructive update is a problem. The problem is dependencies to values: imperative programming languages like C/C++/Java/Ruby/Smalltalk/Python do not force a style of programming that minimizes dependencies. Assignment allows dependencies to be freely hijacked...for example, an iterator which is modified in the wrong way can cause havoc in an algorithm.</description>
			<pubDate>Tue, 28 Nov 2006 10:48:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>nice start</title>
			<link>http://www.osnews.com/thread?186044</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186044</guid>
			<description>I learnt, amongst other languages, basic Haskell in my first year of studying CS. As much was we students hated it in the beginning, having used a functional language at some point certainly helps you even when you're writing code in a different language. It's a certain way of thinking that it teaches you.</description>
			<pubDate>Tue, 28 Nov 2006 10:51:00 GMT</pubDate>
			<author>donotreply@osnews.com (stew)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Uniqueness Typing</title>
			<link>http://www.osnews.com/thread?186057</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186057</guid>
			<description>Referential transparency is one of the core benefits of FP. However, I agree that sometimes it just gets in the way with stuff that can not be easily made referentially transparent, such as IO.<br />
<br />
World-passing and monads are of course a correct solution. But take a look at the language &quot;clean&quot;. They have something called uniqueness typing which lets you use mutable objects in a functionally pure way.<br />
<br />
<a href="http://en.wikipedia.org/wiki/Uniqueness_type" rel="nofollow">http://en.wikipedia.org/wiki/Uniqueness_type</a></description>
			<pubDate>Tue, 28 Nov 2006 12:23:00 GMT</pubDate>
			<author>donotreply@osnews.com (tuttle)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Functional Programming in C# 3.0</title>
			<link>http://www.osnews.com/thread?186103</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186103</guid>
			<description>C# 3.0 is getting a whole boat load of Functional Programming support via LINQ.  There's a nice tutorial on Functional Programming in C# 3.0 here:<br />
<a href="http://blogs.msdn.com/ericwhite/pages/FP-Tutorial.aspx" rel="nofollow">http://blogs.msdn.com/ericwhite/pages/FP-Tutorial.aspx</a> <br />
<br />
It might be more accessible to those wanting to learn FP than is Haskell (the often heard knock against Haskell is, &quot;It's a beautiful language but requires a PHD to understand it&quot; (granted, that's hyperbole)).</description>
			<pubDate>Tue, 28 Nov 2006 14:16:00 GMT</pubDate>
			<author>donotreply@osnews.com (MollyC)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>And here are the counter arguments.</title>
			<link>http://www.osnews.com/thread?186133</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186133</guid>
			<description>Please have a look in this blog I wrote; it contains counterarguments to the defmacro article:<br />
<br />
<a href="http://warp9point99.blogspot.com/" rel="nofollow">http://warp9point99.blogspot.com/</a></description>
			<pubDate>Tue, 28 Nov 2006 15:07:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: And here are the counter arguments.</title>
			<link>http://www.osnews.com/thread?186158</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186158</guid>
			<description>I agree to a degree. I am a big fan of FP, but I have no illusions that I could explain monads to your average java or visual basic programmer, ever.<br />
<br />
And an imperative language that encourages immutable structures wherever possible while still allowing mutable structures would be a big step forward.<br />
<br />
But do you know clean? It is a strict functional language that allows destructive updates by using a concept called uniqueness typing.<br />
<br />
It has all the benefits of FP without having to resort to something as complex as monads. <br />
<br />
In fact, it is easy to write an in-place quicksort in clean.</description>
			<pubDate>Tue, 28 Nov 2006 16:02:00 GMT</pubDate>
			<author>donotreply@osnews.com (tuttle)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: And here are the counter arguments.</title>
			<link>http://www.osnews.com/thread?186223</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186223</guid>
			<description>The problem with your blog is that the whole thing is based on &quot;we can program in a functional style in any language&quot;.  Yes, we can do OO in straight C, but is the language conducive to it.  <br />
<br />
In fact, the one definition of functional programming that is usually given is the absence of side-effects.  Most languages that are considered &quot;functional&quot; do allow side-effects though.  <br />
<br />
Of course, there's really no comparison to the type system of something like Haskell to something like Java, so there's no style of programming advice you can give to overcome that.  And then there's pattern matching and such.</description>
			<pubDate>Tue, 28 Nov 2006 19:27:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Uniqueness Typing</title>
			<link>http://www.osnews.com/thread?186225</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186225</guid>
			<description>Clean also has the advantage of being very fast and very lightweight. It absolutely spanks Java on the debian shootout.</description>
			<pubDate>Tue, 28 Nov 2006 19:29:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186243</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186243</guid>
			<description>And then there's &quot;lazy&quot; evaluation, which really changes the rules of the game in a profound way.<br />
<br />
There's no point in learning Haskell if you're not into it - minimal employment potential etc. - but don't think it's a waste of time because you can more conveniently just do the functional thing with Ruby or something.  Haskell usually takes some time to soak in, because it's quite different.  I have given up on it a couple times because of various impracticalities, but have been sucked back in because really nothing compares.<br />
<br />
Haskell's authors and gurus tend to be very mathematically inclined, and that's great for mathematical rigor but sometimes leaves things cloaked in abstruse explanations.  They'll tell you with a straight face that you need to know category theory to understand monads, for example.  You don't.  When they start with the math stuff, just tune them out and keep writing Haskell programs.  I'm not saying it's an easy language to understand - there's plenty of stuff I don't get, so I don't really know how hard it is!  It just doesn't take a PhD.  (The hard part, if you want to know, is understanding evaluation strategy well enough to avoid stack overflows and similar resource problems.)</description>
			<pubDate>Tue, 28 Nov 2006 20:15:00 GMT</pubDate>
			<author>donotreply@osnews.com (donn)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Uniqueness Typing</title>
			<link>http://www.osnews.com/thread?186248</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186248</guid>
			<description>&gt; Clean also has [...]<br />
<br />
Wake me up when Clean has decent unicode support.<br />
<br />
Seriously, I can't understand how so many programming languages have so moronic text handling. Ruby is a prime example, not least because it's quite new, of this absurdity with its each-character-is-eight-bits-and-I-won't-even-tell-which-bits-are-whic h-characters  line of thought. I think text handling is needed all the time, so IMNSHO language designers should put a lot of effort in designing a good text handling base for the libraries to use.</description>
			<pubDate>Tue, 28 Nov 2006 20:30:00 GMT</pubDate>
			<author>donotreply@osnews.com (msundman)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[3]: Uniqueness Typing</title>
			<link>http://www.osnews.com/thread?186273</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186273</guid>
			<description>Wake me up when Clean has decent unicode support. <br />
<br />
That's irrelevant to me.</description>
			<pubDate>Tue, 28 Nov 2006 21:30:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186279</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186279</guid>
			<description>I agree with you that people tend to freak out and think you need a PhD in category theory to understand Haskell.  Most people when they're starting out just need to understand the do notation.<br />
<br />
Haskell source code is surprisingly clean with it's indentation syntax (if you want), and lack of commas or parentheses for function arguments. <br />
<br />
Here's a simple little OpenGL tutorial program for Haskell.  The indentation will get mangled with the post, but most people should be able to get the gist of it.  Looks pretty easy to read to me. <br />
<br />
--<br />
-- This code was created by Jeff Molofee '99 (ported to Haskell GHC 2005)<br />
--<br />
<br />
module Main where<br />
<br />
import Graphics.UI.GLUT<br />
import System.Exit ( exitWith, ExitCode(..) )<br />
import Data.IORef ( IORef, newIORef )<br />
<br />
increment :: GLfloat<br />
increment = 1.5<br />
<br />
initGL :: IO ()<br />
initGL = do<br />
  clearColor $= Color4 0 0 0 0 -- Clear the background color to black<br />
  clearDepth $= 1 -- enables clearing of the depth buffer<br />
  depthFunc  $= Just Less -- type of depth test<br />
  shadeModel $= Smooth -- enables smooth color shading<br />
  matrixMode $= Projection<br />
  loadIdentity  -- reset projection matrix<br />
  Size width height  IO ()<br />
resizeScene (Size w 0) = resizeScene (Size w 1) -- prevent divide by zero<br />
resizeScene s@(Size width height) = do<br />
  viewport $= (Position 0 0, s)<br />
  matrixMode $= Projection<br />
  loadIdentity<br />
  perspective 45 (fromIntegral width/fromIntegral height) 0.1 100<br />
  matrixMode $= Modelview 0<br />
  flush<br />
<br />
drawScene :: IORef GLfloat -&gt; IORef GLfloat -&gt; IO ()<br />
drawScene rtri rquad = do<br />
  clear [ColorBuffer, DepthBuffer] -- clear the screen and the depth bufer<br />
  loadIdentity  -- reset view<br />
<br />
  translate (Vector3 (-1.5) 0 (-6.0::GLfloat)) --Move left 1.5 Units and into the screen 6.0<br />
  rt</description>
			<pubDate>Tue, 28 Nov 2006 21:37:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: And here are the counter arguments.</title>
			<link>http://www.osnews.com/thread?186283</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186283</guid>
			<description><i>The problem with your blog is that the whole thing is based on &quot;we can program in a functional style in any language&quot;. Yes, we can do OO in straight C, but is the language conducive to it.</i><br />
<br />
Obviously you did not read all of it.<br />
<br />
My message is not that &quot;we can do functional programming in any programming language&quot;.<br />
<br />
My message is that &quot;imperative programming languages are not as good as they can be&quot; and that &quot;referential transparency is not really necessary&quot;.</description>
			<pubDate>Tue, 28 Nov 2006 22:01:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186286</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186286</guid>
			<description><i>There's no point in learning Haskell if you're not into it - minimal employment potential etc. - but don't think it's a waste of time because you can more conveniently just do the functional thing with Ruby or something. Haskell usually takes some time to soak in, because it's quite different. I have given up on it a couple times because of various impracticalities, but have been sucked back in because really nothing compares.</i> <br />
<br />
Actually I have picked it up quite fast...I knew ML, so it was quite easy. You see, Haskell is not all that different from other languages...once you know a few, you can easily learn more.<br />
<br />
But I see no point in referential transparency. It only hinders my productivity instead of helping it. I think referential transparency is unnecessary, and I have not read a single compelling argument about it, other than it generally helps.<br />
<br />
Of course all the gurus will now try to prove me wrong...</description>
			<pubDate>Tue, 28 Nov 2006 22:04:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186287</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186287</guid>
			<description><i>Haskell source code is surprisingly clean with it's indentation syntax (if you want), and lack of commas or parentheses for function arguments.</i><br />
<br />
That's a good property of Haskell, but it is no way derived from its functional properties. Basic is also surprisingly clean, given that it is a line based language.<br />
<br />
The program you posted could easily be done in an imperative language that looks like Haskell but it does not have referential transparency; the program would be just the same, without the monads.<br />
<br />
Here is another challenge for you: an application with an object model that follows the model-view-controller pattern; it should be able to have multiple views attached to the same data, and the views should be automatically updated when the data change.<br />
<br />
It's not difficult to do (so they say). Let me give you some hints: Zipper, Arrows.</description>
			<pubDate>Tue, 28 Nov 2006 22:09:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186293</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186293</guid>
			<description>There is something ironic about driving the OpenGL state machine in a language that is supposed to not have mutable state.</description>
			<pubDate>Tue, 28 Nov 2006 22:28:00 GMT</pubDate>
			<author>donotreply@osnews.com (rayiner)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[3]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186309</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186309</guid>
			<description>That's a good property of Haskell, but it is no way derived from its functional properties. Basic is also surprisingly clean, given that it is a line based language. <br />
<br />
You didn't understand the context of the post.  It was not to demonstrate the functional properties of Haskell.</description>
			<pubDate>Tue, 28 Nov 2006 23:04:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[3]: And here are the counter arguments.</title>
			<link>http://www.osnews.com/thread?186312</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186312</guid>
			<description>Obviously you did not read all of it. <br />
<br />
I did.<br />
<br />
My message is that &quot;imperative programming languages are not as good as they can be&quot; and that &quot;referential transparency is not really necessary&quot;.<br />
<br />
Necessary and desirable are two different things.</description>
			<pubDate>Tue, 28 Nov 2006 23:15:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[2]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186313</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186313</guid>
			<description>But I see no point in referential transparency. It only hinders my productivity instead of helping it. I think referential transparency is unnecessary, and I have not read a single compelling argument about it, other than it generally helps. <br />
<br />
You're not alone.  There's a guy that has been recently been making the same case on comp.lang.functional.  No one ever accuses me of being a purist, so I'll reserve judgement.</description>
			<pubDate>Tue, 28 Nov 2006 23:20:00 GMT</pubDate>
			<author>donotreply@osnews.com (Lambda)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[4]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186412</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186412</guid>
			<description><i>You didn't understand the context of the post. It was not to demonstrate the functional properties of Haskell.</i><br />
<br />
But Haskell has advantages over imperative languages because it is a functional programming language...isn't that all of you FP supporters say?</description>
			<pubDate>Wed, 29 Nov 2006 14:02:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[4]: And here are the counter arguments.</title>
			<link>http://www.osnews.com/thread?186413</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186413</guid>
			<description><i>Necessary and desirable are two different things.</i><br />
<br />
But referential transparency can also be achieved with a language that allows assignment of local variables as well.<br />
<br />
And before you yell 'impossible', think about it.</description>
			<pubDate>Wed, 29 Nov 2006 14:04:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[3]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186416</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186416</guid>
			<description><i>You're not alone. There's a guy that has been recently been making the same case on comp.lang.functional. No one ever accuses me of being a purist, so I'll reserve judgement.</i><br />
<br />
Do you mean this?<br />
<br />
<a href="http://groups.google.com/group/comp.lang.functional/browse_frm/thread/8c32122fa1970299/214b73e137fb96de?" rel="nofollow">http://groups.google.com/group/comp.lang.functional/browse_frm/thre...</a> <br />
<br />
My view is different from the one in the above thread.<br />
<br />
I understand that assignment of any variable from a function breaks referential transparency.<br />
<br />
What I am claiming is that if we restrict assignment to local variables, referential transparency is maintained.</description>
			<pubDate>Wed, 29 Nov 2006 14:13:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[4]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186421</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186421</guid>
			<description>If you really only allow assignments in local variables, it is just a shortcut that lets you write imperative programs easier. But to preserve referential transparency, you would have to make sure that the variable can not be assigned to from a closure that can escape the local scope.<br />
<br />
And I think limiting destructive updates to local variables would be a bit limiting unless you allow local functions to manipulate the local variable. And if you do the latter, it would be abused to create global variables by just having a function wrapping all the code :-)<br />
<br />
I am still not quite sure what your point is.<br />
<br />
a) referential transparency can be achieved without complex constructs like monads? Yes, I agree. See e.g. uniqueness typing.<br />
<br />
b) imperative languages could be better by adopting language constructs that are typically included in functional languages, but that are not limited to functional languages: I agree completely.<br />
<br />
c) referential transparency is useless? I disagree. Concepts like closures and lazy evaluation are much easier to implement and much safer to use if you have referential transparency. I also find it much easier to understand referentially transparent code.</description>
			<pubDate>Wed, 29 Nov 2006 14:55:00 GMT</pubDate>
			<author>donotreply@osnews.com (tuttle)</author>
			<category>Comments</category>
		</item>

		<item>
			<title>RE[5]: Functional programming in [...]</title>
			<link>http://www.osnews.com/thread?186492</link>
			<guid isPermaLink="true">http://www.osnews.com/thread?186492</guid>
			<description><i>If you really only allow assignments in local variables, it is just a shortcut that lets you write imperative programs easier.</i><br />
<br />
But it is an important shortcut...one that preserves the advantages of pure FP without its disadvantages: functions are only affected by their input. There are no external dependencies. In order to test a function, you only need to deal with its input.<br />
<br />
<i>But to preserve referential transparency, you would have to make sure that the variable can not be assigned to from a closure that can escape the local scope.</i><br />
<br />
The type system could see to that by forcing immutable variables inside the closure.<br />
<br />
<i>And I think limiting destructive updates to local variables would be a bit limiting unless you allow local functions to manipulate the local variable. And if you do the latter, it would be abused to create global variables by just having a function wrapping all the code :-) </i><br />
<br />
A local function would not be able to manipulate a local variable of the outer scope; the variable would have to be an argument to function in order to be manipulated. <br />
<br />
Personally I do not see how it is limiting.<br />
<br />
<i>referential transparency can be achieved without complex constructs like monads? Yes, I agree. See e.g. uniqueness typing.</i><br />
<br />
Yes, uniqueness typing is another solution. But I do not see why I have to use special rules in my programming language when certain restrictions are more than enough.<br />
<br />
<i>referential transparency is useless? I disagree. Concepts like closures and lazy evaluation are much easier to implement and much safer to use if you have referential transparency. I also find it much easier to understand referentially transparent code.</i><br />
<br />
I do not agree that lazy evaluation is of any usefulness. It certainly can make writing things like the hamming numbers easier, but such tasks do not seem of any usefulness in reality. In other words, I am in the strict evaluation camp.</description>
			<pubDate>Wed, 29 Nov 2006 22:47:00 GMT</pubDate>
			<author>donotreply@osnews.com (axilmar)</author>
			<category>Comments</category>
		</item>
	</channel>
</rss>

