title: How do I generate a constructor parameter of the Kotlin "Unit" type with a single type parameter with kotlinpoet?
body: <p>This might be a bit too specific for posting here, but I'm trying to generate a class like this with kotlinpoet: </p>
  
  <pre><code>class Query&lt;out E: Model&gt;(val onSuccess: (E) -&gt; Unit, val onError: (Int, String) -&gt; Unit = { i, m -&gt; })
  </code></pre>
  
  <p>How would I create that type/constructor parameter with kotlinpoet? The <a href="https://square.github.io/kotlinpoet/0.x/kotlinpoet/com.squareup.kotlinpoet/" rel="nofollow noreferrer">docs</a> do have the "<code>Unit</code>" type listed along with primitive types, so it seems to be a special case.</p>