Python has optional arguments…
I think the answer to this is currying. It’s not quite as cute:
foo a b = ...
Later becomes
foo = foo1 const
foo1 c a b = ...
If you don’t like sticking c at the front you’ll have to use lambda:
foo a b = \ a b -> foo 1 a b const
foo1 a b c = ...
In some cases you can use flip I suppose. Someone who knows haskell better than me might have better solutions to it…
Oh yes, I have to say that requiring an account is not inviting casual commenters…
Close this Window Bookmark and Share This Page
Copy HTML:
If you like this then please subscribe to the RSS Feed.
![[Digg]](http://therning.org/magnus/wp-content/plugins/bookmarkify/digg.png)
![[Reddit]](http://therning.org/magnus/wp-content/plugins/bookmarkify/reddit.png)
Leave a comment