Re: [go-nuts] pure function on golang

2020-07-13 Thread Kurniagusta Dwinto
Hello guys, thanks for the response, After brainstorming for a while, I think we can implement this without changes in the language, and create static analysis tools for it, What's wrong with my approach before is using the suffix "Pure" as a pure function marker, which is unreliable because

Re: [go-nuts] pure function on golang

2020-07-06 Thread Kurniagusta Dwinto
7, 2020 at 7:34:14 AM UTC+7 Ian Lance Taylor wrote: > On Mon, Jul 6, 2020 at 5:11 PM Kurniagusta Dwinto > wrote: > > > > > It's not obvious to me that "pure" is a characteristic that is > important enough > > > to be singled out and added to th

Re: [go-nuts] pure function on golang

2020-07-06 Thread Kurniagusta Dwinto
reason why this is important beside separation IO and non-IO On Tue, Jul 7, 2020 at 7:05 AM Kurniagusta Dwinto wrote: > Additionally, this feature complement new generic feature, > this feature will help anyone that trying to use functional programming > pattern (like monad pattern) in th

Re: [go-nuts] pure function on golang

2020-07-06 Thread Kurniagusta Dwinto
Additionally, this feature complement new generic feature, this feature will help anyone that trying to use functional programming pattern (like monad pattern) in their code On Tuesday, July 7, 2020 at 6:52:31 AM UTC+7 Kurniagusta Dwinto wrote: > Adding pure marker will give informat

Re: [go-nuts] pure function on golang

2020-07-06 Thread Kurniagusta Dwinto
Adding pure marker will give information to the programmer that the function will not do any side effect, the compiler just gives compile error when the programmer disagrees about the contract, like doing IO operation on pure function. So in the end, this feature focuses on helping the