
10 Aug
2011
10 Aug
'11
10:35 a.m.
Sunil S Nandihalli
I feel forcing the first argument of take to be an Int is unnecessarily restrictive .. Is there a rationale behind not making it just (Integral a) ?
This would be an overgeneralization and you would pay for it with a performance loss. There is no reason to generalize here, because most indexing and counting functions use an Int. If you feel that you might exhaust Int (which is very unlikely on 32 bit and practically impossible on 64 bit), you can use genericTake from Data.List. Data.List.genericTake :: Integral i => i -> [a] -> [a] Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/