indexof :: [Char]->Char->Integer -> Integer
indexof [] _ _ = -1
indexof (x:xs) c i | x == c = i
| x < c = indexof xs c i+1
| x > c = indexof xs c i+1
main = putStr(indexof("foo" 'o' 0))
--Error
testcalc.hs:7:17:
Expecting a function type, but found `[Char]'
Expected type: String
Inferred type: Char -> Integer -> Integer
Probable cause: `indexof' is applied to too few arguments in the call
(indexof ("foo" 'o' 0))
In the first argument of `putStr', namely `(indexof ("foo" 'o' 0))'