Interesting! However, what do you mean by the words "curried function" in the title? I think Foo.doSomething is not curried. For example, if doSomething takes one argument, Foo.doSomething(123) causes an error.
func(fFoo)doSomething(bbool){fmt.Println(f,b)}funcmain(){Foo.doSomething(123)// error: not enough arguments}
Maybe you want to say that Go can pass a receiver to a method value as an argument?
Interesting! However, what do you mean by the words "curried function" in the title? I think
Foo.doSomething
is not curried. For example, ifdoSomething
takes one argument,Foo.doSomething(123)
causes an error.Maybe you want to say that Go can pass a receiver to a method value as an argument?
Yes, in strictly, as you think, this is not currying. The currrying is a transform taking one less argument.
Just metaphor :)
If this function object for currying, you can try this.