All pastes #158474 Raw Edit

freeone3000

public text v1 · immutable
·published 2006-09-02 04:24 UTC
rendered paste body
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))