Reply to post: Re: Rule 3: Functions should be curried.

Learn you Func Prog on five minute quick!

Tom 38

Re: Rule 3: Functions should be curried.

seq_7_10_13_16_19 = map(partial(int.__add__, 4), range(3,18,3))

Much too ugly*:

seq_7_10_13_16_19 = [ val + 4 for val in range(3,18,3) ]

* but you are obviously illustrating the FP aspect of it... list comprehensions are about as functional as I like to go ;)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon