title: Couldn't match expected type `(t1, t2, t0)' with actual type `[a0]`
body: <p>I'm trying to solve a fractional knapsack problem with the input,</p>
  
  <pre><code>[("label 1", value, weight), ("label 2", value, weight), ...]
  </code></pre>
  
  <p>and the output,</p>
  
  <pre><code>[("label 1", value, solution_weight), ("label 2", value, solution_weight), ...]
  </code></pre>
  
  <p>but I keep getting the error in <code>computeKnapsack</code>:</p>
  
  <pre><code>"Couldn't match expected type `(t1, t2, t0)' with actual type `[a0]`"
  </code></pre>
  
  <p>I can't understand what the problem might be. I'm trying to create a list of 3-entry tuples. How can I get it to stop expecting a single 3-entry tuple?</p>
  
  <pre><code>fst3 (a,b,c) = a
  snd3 (a,b,c) = b
  trd3 (a,b,c) = c
  fst4 (a,b,c,d) = a
  snd4 (a,b,c,d) = b
  trd4 (a,b,c,d) = c
  qud4 (a,b,c,d) = d
  
  sortFrac (a1, b1, c1, d1) (a2, b2, c2, d2)
    | d1 &gt; d2 = GT
    | d1 &lt;= d2 = LT
  
  fracKnap (x:xs) =
      fractionalKnapsack (x:xs) []
  
  fractionalKnapsack (x:xs) fracList =
      if length (x:xs) &lt;= 1
          then computeKnapsack (sortBy sortFrac (((fst3 x),(snd3 x),(trd3 x),(snd3 x) / (trd3 x)):fracList)) 100
          else fractionalKnapsack xs (((fst3 x),(snd3 x),(trd3 x),(snd3 x) / (trd3 x)):fracList)
  
  computeKnapsack (x:xs) weightLeft =
      if length (x:xs) &lt;= 1
          then (fst4 x, snd4 x, ((floor (weightLeft / (qud4 x)))*(qud4 x)))
          else (fst4 x, snd4 x, ((floor (weightLeft / (qud4 x)))*(qud4 x))):(computeKnapsack xs (weightLeft-(floor (weightLeft / (qud4 x))*(qud4 x))))
  </code></pre>