hmm.. I do agree that taking elements larger than say 2-billion is insane .. however, I have no intention of doing that. But the thing is the value I am getting is of type Integer but it actually very small and I am unable to pass it as is. So is there a way to convert a value of type Integer to Int ?
> I feel forcing the first argument of take to be an Int isThis would be an overgeneralization and you would pay for it with a
> unnecessarily restrictive .. Is there a rationale behind not making it
> just (Integral 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/
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners