title: join function and type issues haskell
body: <p>I have 2 lists Expressions and bindings (id = Expr), and trying to replace each expression with its equivalent from the bindings list in a new list called newE, where Expression = id ..
  Initially, I have only one expression: </p>
  
  <blockquote>
    <p>eq (div (add 2 7) (sub 5 2)) 3</p>
  </blockquote>
  
  <p>I want to replace each identifier in this expression with its equivalent from the bindings list, so I tried to split this expression into a list of strings and removed brackets, to separate each identifier  ..</p>
  
  <p>This is how I tried to implement it:</p>
  
  <pre><code>newE = [\x -&gt; getExp(b) | x &lt;- eStr, b &lt;- bs, x == getId(b)]
                  where es = getExpressions (prog)
                        bs = getBindings (prog)
                        -- Extracting expression into a list of strings 
                        -- and removing brackets
                        eStr = map (delete ')')(map (delete ')') 
                               (map (delete '(') (split " " (show es))))
  newE' = join " " newE
  </code></pre>
  
  <p>Is this correct?</p>
  
  <p>Now I'm getting errors that newE returns [t0 -> Expr] while it's supposed to return Expr only, why is that?</p>
  
  <p>and the join function is expecting a [Char] .. while its type in the <a href="http://hackage.haskell.org/package/MissingH-0.18.6/docs/Data-List-Utils.html" rel="nofollow">Data.List.Utils</a> documentation is:</p>
  
  <p>join :: [a] -> [[a]] -> [a]</p>
  
  <p>so, isn't it supposed to accept any type not just list of characters? or did it get confused with a 'join' from another library?
  I searched the libraries I've imported, but they don't have a join.</p>
  
  <p>Any help to resolve these errors and modify the code to do what it's supposed to do?</p>
  
  <p>Thank you</p>