title: Calling function in haskell
body: <p>I'm pretty new in Haskell programming. I want to call some functions and save the result in a variable but I don't know how. I read couple of chapters about haskell function in two different book but still don't understand how to do it.</p>
  
  <pre><code>import Data.Map (Map)
  import qualified Data.Map as M hiding (Map)
  
  newtype GenEnv elt = Env (Map Id elt)
  
  newEnv :: GenEnv elt                             -- initialise
  newEnv = Env M.empty
  newtype GenEnv elt = Env (Map Id elt)
  
  newEnv :: GenEnv elt                             -- initialise
  newEnv = Env M.empty
  
  getEnv :: GenEnv elt -&gt; Id -&gt; Maybe elt          -- G(x) (key function)
  getEnv (Env env) var = M.lookup var env
  
  union  :: GenEnv elt -&gt; (Id,elt) -&gt; GenEnv elt    -- G[x:v]
  union  (Env env) (key,elt) = Env (M.insert key elt env)
  
  -- foldr is faster than addToFM_list!
  unionL :: GenEnv elt -&gt; [(Id,elt)] -&gt; GenEnv elt -- list union
  unionL (Env env) pairs  = Env $ foldr (\(k,e) g -&gt; M.insert k e g) env pairs
  </code></pre>
  
  <p>What I'm asking here is NOT for somebody to do my work, asking how to call the functions because I don't understand their signature.</p>