login
my ps
about
contact
home
instructor-led
on-demand!
screencasts
blogs
technical staff
Don Box's Spoutlet
»
Sriram on Currying in C# 2.0
Sriram on Currying in C# 2.0
Don Box's Spoutlet
Home
Contact
Pluralsight Blogs
Scott Allen
Craig Andera
Mark Baciak
Don Box
Keith Brown
Eric Burke
David Cowles
Tim Ewald
Jon Fancey
Kirill Gavrylyuk
Ian Griffiths
Martin Gudgin
Dr. Joe Hummel
Jim Johnson
Meagon Marshall
Matt Milner
Fritz Onion
Pluralsight
Jeffrey Schlimmer
Aaron Skonnard
David Starr
Dan Sullivan
Doug Walters
Jim Wilson
Mike Woodring
Syndication
RSS for Posts
Atom
RSS for Comments
Email Notifications
Go
Recent Posts
Recent Oslo Stuff
Barbara Liskov wins Turing Award
DSL DevCon
Whither SOA Facts?
Oslo Stuff
Tags
.NET
DevCon
DSL
Intellipad
M
MEF
MGrammar
Microsoft
Microsoft Solver Foundation
Mix
Modeling
MSchema
MSF
Oslo
PDC
Quadrant
SOA
SpankyJ
TechEd
XAML
View more
Oslo
Doug Purdy
Chris Anderson
Gudge
Chris Sells
Jeff Schlimmer
Randy Kimmerly
Super Ninja
Pinky
Paul Vick
Archives
March 2009 (2)
February 2009 (3)
January 2009 (1)
November 2008 (2)
October 2008 (2)
September 2008 (6)
August 2008 (4)
July 2008 (3)
June 2008 (6)
May 2008 (3)
April 2008 (1)
February 2008 (4)
January 2008 (6)
December 2007 (2)
November 2007 (13)
October 2007 (9)
August 2007 (3)
May 2007 (6)
April 2007 (2)
March 2007 (5)
February 2007 (2)
January 2007 (13)
December 2006 (8)
October 2006 (2)
August 2006 (1)
July 2006 (3)
June 2006 (11)
May 2006 (15)
April 2006 (6)
March 2006 (7)
February 2006 (2)
January 2006 (9)
December 2005 (13)
November 2005 (4)
October 2005 (12)
September 2005 (15)
August 2005 (7)
July 2005 (32)
June 2005 (10)
May 2005 (8)
April 2005 (18)
March 2005 (4)
February 2005 (24)
January 2005 (5)
December 2004 (6)
November 2004 (20)
October 2004 (24)
September 2004 (5)
Fun code found
here
. Look for the C# 3.0 version in September :-)
Posted
Aug 08 2005, 05:51 AM
by
don-box
Comments
wolm
wrote
re: Sriram on Currying in C# 2.0
on 08-08-2005 11:07 PM
Yes, generics certainly leads to clear and understandable code...
Does someone have an example of when "Currying" is useful?
James Alexander's IMessage
wrote
Continuations
on 08-09-2005 12:06 PM
Is it just me or are people seriously coming up with "common-sense/clear as day" terms and methodologies...
Keith J. Farmer
wrote
re: Sriram on Currying in C# 2.0
on 08-09-2005 7:51 PM
Wolm:
From Wikipedia: "The practical motivation for currying is that very often the functions you get by supplying some but not all of the arguments to a curried function are useful; for example, many languages have a function or operator similar to plus_one. Currying makes it easy to define these functions."
Lecture notes on currying: http://www.informatics.sussex.ac.uk/courses/funcprog/Handouts/lecture5.pdf
I'll leave it to you to actually look things up, if you're interested. Personally, I'm more gung-ho over LCG.
wolm
wrote
re: Sriram on Currying in C# 2.0
on 08-09-2005 11:23 PM
Yes -- I read the Wikipedia too, but I didn't find the lecture. Thanks for that.
But still. I'm looking for a useful example beyond "an easy way to define a function for the ++ operator".
Or in other words: How is currying going to help me in my everyday software development?
Sriram Krishnan
wrote
Winning an Oscar
on 08-10-2005 12:47 PM
Within the span of 2 days, I get linked to by first Don Box and now, Rico Mariani. This has meant that...
Ivan Tikhonov
wrote
Useful currying
on 01-08-2006 2:48 AM
Currying useful to create anonymous functions without writing lambdas.
imagine that we need to append 2 for each element of list l. In haskell it will be:
let f = \x -> add(x, 2) -- creating lambda
in map(f, l) -- applying it to list
with currying it looks like:
let f = add 2
in map f l
Evaluation of (add 2) returns function which accepts single argument and sums it with 2.
Add a Comment
Name:
(required)
Website:
(optional)
Comments
(required)
Remember Me?
home
instructor-led training
online training
blogs
781.749.9238 (East Coast) | 310.251.9901 (West Coast) | Pluralsight, LLC , 185 Lincoln St., Suite 305, Hingham, MA 02043-1741
Copyright © 2008 Pluralsight LLC. All rights reserved.
designed by
nukeation