[Haskell-cafe] Re: Best way to write endsWith (RESOLVED)

2006-10-22 Thread John Ky
Hi,Thanks all. I learnt quite a few things:1. There was already an equivalent builtin function.2. That the best function argument order is the least surprising one.3. That I can choose my preferred function order by changing the name of the function. 4. That the most efficient way of doing

[Haskell-cafe] Re: Best way to write endsWith

2006-10-21 Thread Stephan Walter
John Ky wrote: Hello, I have this function here: endsWith :: Eq a = [a] - [a] - Bool endsWith suffix list | lengthDifference 0 = False | otherwise = (drop lengthDifference list) == suffix where lengthDifference = (length list) - (length suffix) I thinks that's what

Re: [Haskell-cafe] Re: Best way to write endsWith

2006-10-21 Thread Lemmih
On 10/21/06, Stephan Walter [EMAIL PROTECTED] wrote: John Ky wrote: Hello, I have this function here: endsWith :: Eq a = [a] - [a] - Bool endsWith suffix list | lengthDifference 0 = False | otherwise = (drop lengthDifference list) == suffix where lengthDifference = (length list)