title: Omitting Unary Constructors
body: <p>I am writing some code to express "expressions" built from members of a given type:</p>
  
  <pre><code>data Expr a = Simply a | Add (Expr a, Expr a) | Mult (Expr a, Expr a) 
  </code></pre>
  
  <p>One can define some infix operators to make it more convenient to construct these:</p>
  
  <pre><code>(+++) :: Expr a -&gt; Expr a -&gt; Expr a
  x +++ y = Add (x, y)
  
  (***) :: Expr a -&gt; Expr a -&gt; Expr a
  x *** y = Mult (x, y)
  </code></pre>
  
  <p>Hence one can just write</p>
  
  <pre><code>(Simply "bar") +++ ((Simply "fo") *** (Simply "o"))
  </code></pre>
  
  <p>to get</p>
  
  <pre><code>Add (Simply "bar",Mult (Simply "fo",Simply "o"))
  </code></pre>
  
  <p>Now the question is if there is a way to omit the constructor <code>Simply</code> as well, i.e. to consider any member of the type <code>a</code> implicitly as a member of <code>Expr a</code> and obtain the example above directly from <code>("bar") +++ (("fo") *** ("o"))</code>.</p>