title: split function 'no instance for' error
body: <p>this function should tokenize a String:</p>
  
  <pre><code>    split s c xs i j =
          if head s == c
          then split s c (subStr s i j : xs) j (j + 1)
          else if j == length s
          then (subStr s i j) : xs
          else split s c xs i j + 1
      subStr s i j = take j(drop i s)
  </code></pre>
  
  <p>However I get the following error msg:
  No instance for (Num [[Char]]) arising from a use of 'split'
  Possible fix: add an instance declaration at (Num [[Char]])</p>
  
  <p>Thanks.</p>
  
  <p>Ok function is now:</p>
  
  <pre><code>split s c xs i j =
          if j == length s
          then (subStr s i j) : xs
          else if head (drop j s) == c
          then split s c (subStr s i j : xs) (j + 1) (j + 1)
          else split s c xs i (j + 1)
  
  subStr s i j = take j(drop i s)
  </code></pre>
  
  <p>now when I apply the function with the following args: split "123,456,789" ',' [] 0 0 I get the result ["789", "456,789", "123"] what's happening here?</p>