This might be very easy, but I can't figure it:

I need the length of a list and it should be of type Integer, while the
prelude function yields type Int.

Is there a more clever way to get the result of the right type than just
adding a new version of length, namely:

lengthInteger::[a]->Integer
lengthInteger [] = 0
lengthInteger (_:xs) = 1 + lengthInteger xs
-- 
Stephan Tobies, Student of Computer Science, RWTH Aachen
      mailto:[EMAIL PROTECTED]
## There is much pleasure to be gained
                   from useless knowledge - B. Russel ##


Reply via email to