title: Function currying in Haskell
body: <p>I have a function:</p>
  
  <pre><code>powerOf :: Int -&gt; Int -&gt; Int
  </code></pre>
  
  <p>example os usage:</p>
  
  <pre><code>*Main Data.List&gt; powerOf 100 2
  2
  *Main Data.List&gt; powerOf 100 5
  2
  </code></pre>
  
  <p>I have two questions. First - why it doesn't works:</p>
  
  <pre><code>map (powerOf 100) [2, 5]
  </code></pre>
  
  <p>I want to get [2, 2].</p>
  
  <p>And second question.  I trying to create pariatl function. Something like this:</p>
  
  <pre><code>powerOfN :: Int -&gt; Int
  powerOfN num = powerOf num
  </code></pre>
  
  <p>to use it such way:</p>
  
  <pre><code>let powerOf100 = powerOfN 100
  powerOf100 2
  powerOf100 5
  </code></pre>
  
  <p>but i got the error message:</p>
  
  <pre><code>simplifier.hs:31:15:
      Couldn't match expected type `Int'
             against inferred type `Int -&gt; Int'
      In the expression: powerOf num
      In the definition of `powerOfN': powerOfN num = powerOf num
  </code></pre>
  
  <p>Here is full of may code:</p>
  
  <pre><code>divided :: Int -&gt; Int -&gt; Bool
  divided a b = 
    let x = fromIntegral a
        y = fromIntegral b
    in (a == truncate (x / y) * b)
  
  listOfDividers :: Int -&gt; [Int]
  listOfDividers num =
                 let n = fromIntegral num
                     maxN = truncate (sqrt n)
                 in [n | n &lt;- [1.. maxN], divided num n]
  
  
  isItSimple :: Int -&gt; Bool
  isItSimple num = length(listOfDividers num) == 1
  
  listOfSimpleDividers :: Int -&gt; [Int]
  listOfSimpleDividers num = [n | n &lt;- listOfAllDividers, isItSimple n]
                       where listOfAllDividers = listOfDividers num
  
  powerOfInner :: Int -&gt; Int -&gt; Int -&gt; Int
  powerOfInner num p power
               | divided num p = powerOfInner (quot num p) p (power + 1)
               | otherwise = power
  
  powerOf :: Int -&gt; Int -&gt; Int
  powerOf num p = powerOfInner num p 0
  
  
  powerOfN :: Int -&gt; Int
  powerOfN num = powerOf num
  </code></pre>
  
  <p>powerOf return maximum power of p in num. For example: 100 = 2 * 2 * 5 *5, so powerOf 100 2 = 2. 10 = 2 * 5, so powerOf 10 2 = 1.</p>
  
  <p>How to fix errors? Thanks.</p>