title: Can methods be created for function types?
body: <p>I know methods can be created for specific types</p>
  
  <p>Example</p>
  
  <pre><code>type MyFunc func() int
  
  func (f MyFunc) eval() int {
      return f()
  }
  
  func main() {
     var randomFunction MyFunc = func() int {
        return 1;
    }
  
    fmt.Println(randomFunction.eval()) // prints 1
  }
  </code></pre>
  
  <p>But <code>randomFunction</code> had to be declared as with <code>MyFunc</code> type. If the declaration looked like</p>
  
  <pre><code>randomFunction := func() int {
    return 1;
  }
  </code></pre>
  
  <p>the method call wouldn't had worked.</p>
  
  <p>My question is whether methods can be created for every function with <code>func () int</code> type, for example.</p>
  
  <p>I know Go is not functional, nor does contain too many functional idioms, but the I'm looking for an approach similar to Haskell's show instance for functions:</p>
  
  <pre><code>instance Show (Int -&gt; Int) where
     show op = show "Function with 1 Int param and Int return type"
  </code></pre>