title: Is there any efficient way to convert an unary number to a binary number?
body: <p>Let those datatypes represent unary and binary natural numbers, respectively:</p>
  
  <pre><code>data UNat = Succ UNat | Zero
  data BNat = One BNat | Zero BNat | End
  
  u0 = Zero
  u1 = Succ Zero
  u2 = Succ (Succ Zero)
  u3 = Succ (Succ (Succ Zero))
  u4 = Succ (Succ (Succ (Succ Zero)))
  
  b0 = End                   //   0
  b1 = One End               //   1
  b2 = One (Zero End)        //  10
  b3 = One (One End)         //  11
  b4 = One (Zero (Zero End)) // 100
  
  (Alternatively, one could use `Zero End` as b1, `One End` as b2, `Zero (Zero End)` as b3...)
  </code></pre>
  
  <p>My question is: is there any way to implement the function:</p>
  
  <pre><code>toBNat :: UNat -&gt; BNat
  </code></pre>
  
  <p>That works in <code>O(N)</code>, doing only one pass through UNat?  </p>