title: Free Monad for AST > 1-arity?
body: <p>When I'm saying <code>1-arity | 2-arity | n-arity</code>, I'm referring to tree in grap theory <a href="https://en.wikipedia.org/wiki/K-ary_tree" rel="noreferrer">k-ary tree</a> : </p>
  
  <blockquote>
    <p>a k-ary tree is a rooted tree in which each node has no more than k children</p>
  </blockquote>
  
  <p>I have been using Free Monad in my project to create a small eDSL in haskell... but all the example I have seen are only 1-ary tree (Linear AST) like this one : </p>
  
  <p><a href="https://i.stack.imgur.com/abYdY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/abYdY.png" alt="enter image description here"></a> </p>
  
  <p>this datatype lift on <code>Free</code> Monad :</p>
  
  <pre><code>data Toy b next =
      Output b next
    | Bell next
    | Done
  </code></pre>
  
  <p>I would like to implement a more complex eDSL than a Linear one... Is Free Monad a solution for that ? and if yes, do you have examples of Free Monad > 1-Ary  ?  </p>